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!
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
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 temp
pdftk burst ../original.pdf
Code: Select all
convert-im6.q16 pg_0001.pdf pg1.png
convert-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.png
convert-im6.q16 pc1_0.png pc1_0.pdf
...