Conversion Tools ⇒ How to convert from a 2nup pdf to a single page one
How to convert from a 2nup pdf to a single page one
I have a pdf file with 2 nup sub-pages per landscape page and I need to convert this to an upright document whose pages are the sub-pages. I tried to use pstops but I could not make out how to do this. I can also use the other psutils, poppler, pdfjam, pdftk and Texlive, And of course I can use Gimp or something like it to make the separation by hand, but this will be too much work,
Any help will be very welcome!
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
How to convert from a 2nup pdf to a single page one
- use pdftk, or any similar tool to create a pdf file for each page in the original document
Code: Select all
mkdir temp ; cd temppdftk burst ../original.pdf
Code: Select all
convert-im6.q16 pg_0001.pdf pg1.pngconvert-im6.q16 pg1.png -crop 2x1@ +repage pc1_%d.png
- now convert each subpage file to pdf
Code: Select all
convert-im6.q16 pc1_0.png pc1_0.pdf
How to convert from a 2nup pdf to a single page one
Instead of using pdftk to get the pages and then converting them to png, pdfimages should be used to get the images as they are in the pdf, keeping its resolution and format (png, jpeg, ...):
Code: Select all
pdfimages -f 1 -l 4 -all ../original.pdf pg
Then follows the cropping of the subpages as before:
Code: Select all
convert-im6.q16 pg1.png -crop 2x1@ +repage pc1_%d.pngconvert-im6.q16 pc1_0.png pc1_0.pdf...