I meant to add that sadly the Table of contents (TOC) functionality can’t be done via the styled HTML. If you want fine control of the TOC you’ll need to get into XSLT. Good grief, all that ‘just’ to make a PDF. Still, massive kudos to all those who kindly made and shared this code. Otherwise the solution is pay-for and not cheap**.
** I looked at this in some depth a while back. Having chivvied Eastgate into doing HTML help out (and using Tinderbox to do it) I felt bad for those whose can’t understand who to use hypertext and need a long form document to work from, thus the above.
Sorry, yes. It’s not an app. Download/install the software from wkhtmltopdf and then run the command line in Terminal.
If I recall: Prince - Buy Prince only $495 for a single desktop licence. OK, it’s intended to do far more. But, that’s the irony, if you ‘just’ want to use styled HTML to make a PDF
Fellow forum members feel free to point up better/cheaper solutions. I did the recce on this about 5 years back and things move on…
Greetings. I need some help with printing out several notes, onto the same PDF page. Actually, 4 per A4 page (landscape) so I can cut them out into A6s.
Please see the attached sample files of what I’m trying to achieve. Any and all How To’s and tips will be great! Thank you. Sample for Printing.tbx (146.9 KB)
Tinderbox is not a desktop-publishing/page layout app. So as you’ve discovered you can print the view (i.e. what you see there) or the text pane, i.e. the $Text of the note. Select multiple notes and click in the text pane and print, you get all the selected note’s text.
However you want a quite precise page layout, so we have to approach this indirectly. This likely can be done by using HTML export and then using pandoc or print-to-PDF from a web browser to make the PDF.
It seems you want:
all child articles of container ‘Notes’
a two-column layout
landscape page orientation
per page item order (left to right/top to bottom) of note $SiblingOrder 2,1,4,3
per ‘cell’:
$Title + space-plus-ellipsis
A horizontal rule
Ellipsis-plus-space + $Text
Unclear:
title/text styling, if any (i.e. ^value($Text)^ vs ^text^, etc)
use of images, if any
So, possible, but not a 5 minute-job and requiring a fair degree of skill with HTML. I’ll let someone else take a crack at expanding this—if you need more help, I’m buried with work at present.
Just curious, I would consider using MultiMarkdown and Marked in a table. Might be simpler and Marked has some nice easy export from Tinderbox or any text application. You might try that as well.
I note this as I was thinking about the fact that an HTML table probably isn’t the best approach and that <div>s and float positioning give more control in ‘table’ making, such that the eventual ‘print’ to PDF works as intended. It’s also why I suggested this wasn’t a simple 5-min task. This is not something basic table syntax will solve well, noting the “beautiful PDFs” in the thread title.
Given that Markdown is just inline markup for a limited subset of HTML I’m wondering how far this would get to the actual layout needed. Mixing Markdown with extra HTML seems to add complexity, might as well start out with the tool you are going to use: I’m sure opinions will vary. To be clear, I say that note to criticise Markdown as a technique but in regards to its suitability to achieve the degree of subtlety of layout-related code needed.
One practical point, arising form the order of the Tinderbox outline source vs. use on-page in the PDF, I’d consider either:
storing the source notes in the order they will be exported
storing the order in an attribute that can be used with an agent to export in the desired order (so the current outline order is maintained)
More radical, but if the key point is the end PDFs, you might consider structuring the source notes to assist the export. For instance, per-page (and per-row?) containers. The source notes are ‘cells’ in the layout whether using a table or stacked divs in a bounding box. A note doesn’t have to export any content. It can equally well act as an anchor for a template, such that the relationship of source and the template cascade can be seen—this is can be useful for those whose struggle abstracting the structure for the mind’s eye.
It’s been some years since I got deep into @media CSS and printing and I wondered about setting (signalling) intended page size—for fine control of design/test. This stackoverflow thread might be of use.
CSS Grid Layout (aka “Grid” or “CSS Grid”), is a two-dimensional grid-based layout system that, compared to any web layout system of the past, completely changes the way we design user interfaces.
@pat, great! Can we invite you to an April meetup where you walk us all through on how to do this? It would be great to revisit this thread and teach people.
I had am easy method (if your data could fit through a Keynote v1 [sic] format file during the process. IIRC is used a ‘blank’ file in an early version of OmniOutliner. Basically, it seems both Apple and Microsoft make the XML of their prez software deliberately and increasingly baroque to freeze out simple inter-doc-format translation.
I suspect pandoc can probably do HTML pages to a PPT (Keynote less likely)
Here’s my Tinderbox → Keynote demo that seemingly I updated in v9.6 (I don’t recall!) TB-to-Keynote v96.zip (456.5 KB). Instructions included. The method was worked out originally way back the early days of Tinderbox v5—so c.2010!
Hmm. I’m still on Ventura (I know, I ned to update…) but poking in the app(let) I see it was made in Script Debugger v4.5.4 (we’re now on v8.x!). But, thanks for flagging this.
Likely the app is updatable, but it means walking back over all the old code and figuring what Apple’s deprecated/broken since, so not an instant task (especially unless anyone has a pressing need vs. general interest). That said, the script within the app is:
property presName : "Tinderbox Presentation"
tell application "Finder"
set myPath to (folder of (path to me)) as text
set srcPresPath to myPath & "template.key"
set srcDataPath to myPath & "presentation.apxl"
if not (exists file srcDataPath) then
set theWarning to "No 'presentation.apxl' file found. (Did you remember to export your Tinderbox data?)" & return & return & "This script will now quit"
display alert theWarning buttons {"OK"} as warning
return
end if
-- get the desired Keynote file name
try
set dialogAnswer to display dialog ¬
"Please name your new Keynote file: " default answer presName buttons {"Cancel", "OK"} ¬
default button "OK"
if button returned of dialogAnswer is "OK" then
set presName to text returned of dialogAnswer
set blnHasExt to false
if (characters -4 through -1 of presName as text) is equal to ".key" then
set blnHasExt to true
else
set presName to presName & ".key"
end if
if (blnHasExt and presName is equal to "Template.key") or presName is equal to "Template" then
display alert ¬
"To avoid overwriting the source Keynote, your file will use the TB-pres default name for the new file." buttons {"OK"} as warning
set presName to "TB-pres"
end if
else
display alert "Action cancelled: no new Keynote file will be created." & return ¬
& "N. B. This script will now quit." buttons {"OK"} as warning
return
end if
on error number -128 -- userCanceledErr
display alert "Action cancelled: no new Keynote file will be created." & return & return ¬
& "N.B. This script will now quit." buttons {"OK"} as warning
return
end try
set srcNewPresPath to myPath & presName
set oldPresPath to quoted form of POSIX path of srcPresPath
set newPresPath to quoted form of POSIX path of srcNewPresPath
-- warn before overwriting existing same-name file
if exists file srcNewPresPath then
set theQuestion to "A previous version of Keynote file '" & presName & "' already exists." & return & return & "Do you wish to overwrite it?"
try
set dialogAnswer to display dialog theQuestion ¬
buttons {"Yes", "No"} ¬
default button "No"
if button returned of dialogAnswer is "No" then
display alert "Script will now quit." buttons {"OK"} as warning
return
end if
on error number -128 -- userCanceledErr
display alert "Script will now quit." buttons {"OK"} as warning
return
end try
end if
set dittoParams to " " & oldPresPath & " " & newPresPath
do shell script "ditto" & dittoParams
set oldDataFilePath to quoted form of POSIX path of srcDataPath
set newDataFilePath to quoted form of POSIX path of (srcNewPresPath & ":presentation.apxl")
set mvParams to " " & oldDataFilePath & " " & newDataFilePath
do shell script "mv" & mvParams
open srcNewPresPath
end tell
-- bring Keynote to the front
tell application "Keynote"
activate
end tell