My solution has been to produce PDF and split it into pages (pdftk document.pdf burst) and then combine them with Scribus. With Scribus it is also practical to add metadata into the document. Very laborous.
With Scantailor I insert one extra page into input images. It's size is exactly A4. The page can be produced with Scribus (export as image) but also from command line in the input directory.
Code: Select all
gs \ -o Zzz-temporary.pdf \ -sDEVICE=pngmono \ -dCompressPages=true \ -sColorConversionStrategy=Gray \ -sPAPERSIZE=a4\ -c showpage convert -units pixelsperinch -monochrome Zzz-temporary.pdf -compress LZMA -density 300 Zzz-A4.tif rm Zzz-temporary.pdf
- Zzz in the name sends the page to end.
- Set the margins to zero for this page.
- This A4 page must be bigger than any of the other pages with margins.
- Maybe there is even easier ways to produce the page.
- Available papersizes here.
- Custom "-sPAPERSIZE=" is possible.
- -dDEVICEWIDTHPOINTS=[width] plus -dDEVICEHEIGHTPOINTS=[height] is possible
- Now all the final images in out-directory are all of the size A4.
- Remove Zzz-A4.tif from the out-directory before proceeding.
Quite often the books page size happens to be near A4 standard. I mean the long edge is approximately square root 2 times the short. Short * sqr(2) = Long. Sometimes it might be a good idea to make the page edges to exactly match this sqr(2) ratio for printing purposes.
I think it is a piece of a cake to write a script to pick the biggest paper(short edge) from file.ScanTailor -file and multiply it by sqr(2). Then compare it to biggest paper(long edge). Whichever is bigger that defines the long edge. And short edge is long/sqr(2).
Then just make the empty page accordingly.