Written by James McDonald

December 11, 2007

I have in the past used Ghostscript to rotate PDFs however this time I used a utility call pdftk

On Ubuntu 7.10 it is easily installed using the command:

sudo apt-get install pdftk

To rotate a pdf 90 degrees to the right (the entire document in this example) you run the following command

pdftk input.pdf cat 1-endE output output.pdf

As far as I can tell the above means take input.pdf and create a new pdf (cat) and using the 1st page till the end (1-end) of the document rotate it to the East 90° (E) and the resulting new document should be output to the file name output.pdf

If you run man pdftk at a command prompt you will see it’s options and some examples which will help. It has a heap of features

To merge multiple pdf documents into one file:

pdftk site_plan_existing1.pdf site_plan_proposed1.pdf elevationsE.pdf joist_bearer_post_detail.pdf output RearDeckReno.pdf

This is a real world example of a heap of PDF’s created from printing from QCAD to the Ubuntu default PDF printer. Then using pdftk to rotate them so they are oriented correctly then use pdftk to merge them into one document

Rotate 90 Degress to Right (West)

pdftk input.pdf cat -W output myOutput.pdf

1 Comment

  1. Ben

    Thanks. I find these examples to be very helpful and I appreciate you posting them here.


Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

PDF Poster

PDF Poster

Start with a wide long image. This is just a screen shot of my desktop. widescreen.png Convert it to postscript using...