So I searched for a way to be able to selectively rotate pages in a PDF document. As always, I like command line tools that are open source.
Enter pdftk - The PDF toolkit.
To solve my particular problem, the command is:
pdftk input.pdf cat 1 2S 3 4S output output.pdf
Here's a brief explanation:
cat - assembles the pages mentioned
1 2S 3 4S - these are the pages needed. I couldn't find an easy way to say rotate only the even pages but still print out the odd pages, so I had to enumerate the pages
output - specifies the output filename
1 comment:
Thanks for the tip.
More generic code, to turn every other page regardless of the number of pages. Assumes the first page and all odd-numbered pages are right way up, the other pages are to be rotated 180 degrees.
pdftk orig.pdf cat 1-endevenD output even.pdf
pdftk orig.pdf cat 1-endodd output odd.pdf
pdftk A=odd.pdf B=even.pdf shuffle A B output new.pdf
Post a Comment