Best practice in exporting to pdf?

Is there a recommended way to export a container as a pdf?

Currently,
Method 1: I am exporting the entire tinderbox file as html export then using DEVONthink to convert it to a pdf

Method 2: I am using Preview the using copy and pasting into Devon as a RTF then converting to pdf

Just wanted to get idea if there were other ways people were exporting tinderbox files to pdf

Thanks in advance
Tom

You don’t need DEVONthink for method #1. Export the the note(s) as a single HTML page, including CSS media rules for print, open the page in a browser (I use Safari) and ‘print’ to PDF. Done. You can see specimen styles in the aTbRef TBX (see in the CSSroot-level containeer)

As to the best method, I’m not sure :slight_smile:

1 Like

This is what I do.

1 Like

Is there a way of automating the PDF file production in the meantime say for all the notes in a given container. I’ve used TB to prepare interview questions which I would like to convert to PDF and rehearse in my Remarkable tablet. There are 45 notes.

Yes I could perform the action select note, export note to .html, load in Safari and save as PDF 45 times. I’m hoping there is a better way.

1 Like

My first impulse would be to put all the notes in a container — or gather them in an agent, if that’s inconvenient.

Then, export them to a single HTML page using ^children(…).

Then, open the HTML page in Safari, or Word, or Pages, and export to PDF.

You’ll probably want to adjust the CSS to get nice margins, fonts, and such appropriate to your Remarkable. This ought to be very straightforward!

Yes, I do it all the time.

You can check out this video: 5CS TBX PDF and Pandoc Publishing: Libraries and Templates (Video).

The easiest way to do this is to set up a run command that sends your files to a command-line app like weasyprint. The key is to pass the exported string to the command line.

Here is a simple file.

TBX_SimplePDFExport_5Cs.tbx (154.0 KB)

If you do a lot of this, there are tons of edge cases to consider (note names, paths, outline depths, style sheets, header footers, and more), which my 5Cs library addresses, or you can deal with these manually using the SimplePDFExport_5Cs file I’ve supplied.

In this setup you’ll want to install Homebrew, use this from the command line /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)". Once Homebrew is installed, you’ll want to install weasyprint, i.e., run brew install weasyprint. You then run which weasyprint from the terminal to get is path, probably: /opt/homebrew/bin/weasyprint if your are on Apple Silicon. You’ll also want to setup an export path (see the stamp).

This way you can export to PDF without leaving Tinderbox.

Whole setup process could take less than 10 minutes.

That’s terrific if you want to export all the time! But I think it’s probably overkill for a one-time export task.

Some other ideas:

  • Select all the notes you want to export. Go to the text pane: Select All. Copy, Paste into Pages or whatever word processor you prefer. Format, save as PDF.

  • Put all the notes in a container. Select the container, Export ▸ As Text to Word (.docx) format. Open the exported file in Word or Pages or whatever you like, and Save As/Export To PDF.

Agreed.

Even easier way to export 40 notes to pdf:

  • select the notes
  • click in the text pane
  • File ▸ Print : Save as PDF
1 Like

For simple projects I export the note(s) as a single HTML page then print to PDF. If necessary, CSS has limited styling for things like widows and orphans though note it is not full pagination control. FWIW, the aTbRef source TBX (available for download the site’s home page) has some CSS for just this purpose.

Keep in mind that there now exist CSS properties for break-before, break-inside, and break-after!

I should say that I find this entire topic illuminating for just how much things have improved in recent years.,

2 Likes

My memory failed me. Yes I am using those break methods in aTbRef’s @print styles. See the TBX at path /CSS/pdf-print.

(I developed the CSS for making linearised PDF prints of aTbRef and Tinderbox Help.)