Linux.com

Re:Missing page rotations

Posted by: Anonymous Coward on May 11, 2006 12:42 AM
This one had me stumped for a while. Finally solved it using sed.

Uncompress the document:
<tt>pdftk input.pdf output output.pdf uncompress</tt>
Replace all Rotate 0 entries with Rotate 90, 180, or whatever:
<tt>sed -i "s/Rotate 0/Rotate 90/g" output.pdf</tt>
Recompress the document if desired:
<tt>pdftk output.pdf output final.pdf compress</tt>
All done. If you want to only rotate a certain page or pages, you'll need to extract those pages to a seperate pdf first, rotate those, then recombine.

I feel really clever right now, hope this helps someone.



Niosop

#

Return to Manipulating PDFs with the PDF Toolkit