Combining PDFs with a page break
Hi, Fairly sure the answer is "that will need an external application". But I have two Therion output PDFs. (Imagine plan and elevation, if that helps you.) I want to combine them into a single PDF. Easy enough, use: map-image 0 0 ne But what if I want them in the same PDF, but always separated by a page break in the PDF, so that the user can select "print page 2" to print just one of them? Cheers, Tarquin
Yes, you need an external tool to combine them. In case you use linux that is easy: `pdfjam file1.pdf file2.pdf -o out.pdf" Am 2025-01-13 08:11, schrieb Tarquin Wilton-Jones via Therion:
Hi,
Fairly sure the answer is "that will need an external application". But I have two Therion output PDFs. (Imagine plan and elevation, if that helps you.) I want to combine them into a single PDF. Easy enough, use: map-image 0 0 ne
But what if I want them in the same PDF, but always separated by a page break in the PDF, so that the user can select "print page 2" to print just one of them?
Cheers,
Tarquin _______________________________________________ Therion mailing list Therion@speleo.sk https://mailman.speleo.sk/listinfo/therion
Yes, you need an external tool to combine them.
Thanks for confirming my suspicions.
In case you use linux that is easy: `pdfjam file1.pdf file2.pdf -o out.pdf"
Since this is intended to be open source, I was really hoping not to rely on an external tool. Code branching is the opposite of fun for; if windows and the user has installed PDFtk, use this external executable path, else if linux and pdfjam, use this command else if mac, use this command else go into meltdown I already have to do that for wkhtmltopdf to tidy up a bunch of the HTML outputs and incorporate them, and it is a maintenance nightmare when sharing the codebase. Hence my wish for something internal. Much sadness. But thanks for the answer anyway. Tarquin
For such cases, I ususally make myself a "build script" that executes the neccessary steps to produce my desired output. in this case it would be some therion commands, and then a final pdfjam one. I would think that adding something "internal" like this could very easily lead to code bloat and feature creep. But wasn't there some thconfig command to execute arbitary code after he compile? Am 2025-01-13 11:37, schrieb Tarquin Wilton-Jones via Therion:
Yes, you need an external tool to combine them.
Thanks for confirming my suspicions.
In case you use linux that is easy: `pdfjam file1.pdf file2.pdf -o out.pdf"
Since this is intended to be open source, I was really hoping not to rely on an external tool. Code branching is the opposite of fun for; if windows and the user has installed PDFtk, use this external executable path, else if linux and pdfjam, use this command else if mac, use this command else go into meltdown
I already have to do that for wkhtmltopdf to tidy up a bunch of the HTML outputs and incorporate them, and it is a maintenance nightmare when sharing the codebase.
Hence my wish for something internal. Much sadness.
But thanks for the answer anyway.
Tarquin _______________________________________________ Therion mailing list Therion@speleo.sk https://mailman.speleo.sk/listinfo/therion
On 13/01/2025 10:42, Benedikt Hallinger wrote:
For such cases, I ususally make myself a "build script" that executes the neccessary steps to produce my desired output. in this case it would be some therion commands, and then a final pdfjam one. I would think that adding something "internal" like this could very easily lead to code bloat and feature creep.
I don't really see "add a page break at this point" to be feature creep. We can already combine PDFs internally, but only onto the same page. Having a combined plan, elevation, overview, in the same PDF seems pretty much within scope of Therion - many surveys are produced that way already, but with the restriction that they can only be on one page. Therion also natively creates multi-page PDFs when using atlas mode.
But wasn't there some thconfig command to execute arbitary code after he compile?
Yes, I do that to run wtkhtmltopdf so it is just a Therion .thconfig to run. Run it, it outputs the cavelist, then my wtkhtmltopdf script cleans it up, generates a PDF of the cave coordinates, and then the main plan.thconfig embeds that PDF in the plan survey, so you can see the coordinates.
On 2025-01-13 10:37 +0000, Tarquin Wilton-Jones via Therion wrote:
Since this is intended to be open source, I was really hoping not to rely on an external tool. Code branching is the opposite of fun for; if windows and the user has installed PDFtk, use this external executable path, else if linux and pdfjam, use this command
pdftk works on linux too, and in fact is what I would have used/suggested as I never heard of pdfjam. Seem it is part of TeX, which of course we have anyway for Therion, so it does make sense in this context.
Hence my wish for something internal. Much sadness.
I take your point that therion probably could be extended to do multipage non-atlas PDFs with maps and headers allocated to different pages, or as you say: <some layout><page break><more mayout> might be the right paradigm. It might not even be too difficult... Wookey -- Principal hats: Debian, Wookware http://wookware.org/
participants (3)
-
Benedikt Hallinger -
Tarquin Wilton-Jones -
Wookey