I have a PDF with A4 pages. Each page contains two identical A5 pages for printing reasons. What I want to do in my Java program is to split these pages and use each unique
A possibly less clunky solution for the record, using pdfjam
-related bits. If test.pdf is an A4 landscape doc to be split into A5 portrait:
1) extract left half-pages
pdfcrop --bbox "0 0 421 595" --clip --papersize "a5" test.pdf test-left.pdf
Note: --bbox "
works in bp units
2) extract right half-pages:
pdfcrop --bbox "421 0 842 595" --clip --papersize "a5" test.pdf test-right.pdf
3) collate pages as desired, e.g.
pdfjoin test-left.pdf test-right.pdf "1" --outfile test-collated.pdf
4) reglue:
pdfnup --nup 2x1 test-collated.pdf --a4paper --outfile test-done.pdf