Archive for March, 2011

Rotate a single page in a PDF file

First, install pdftk:

apt-get install pdftk

To rotate the 19th page 180º:

pdftk input_file.pdf cat 1-18 19D 20-end output output_file.pdf

input_file.pdf: The path of the PDF file you want to modify.
cat 1-18 19D 20-end: Create a new PDF using these parts from the input file:

  • Pages from 1 to 18, let them as they are.
  • Rotate the 19th page 180º.
  • Pages from 20 to the end, let them as they are.

output_file.pdf: The path of the new PDF that will be created.

The rotation degrees are:

  • D: 180º.
  • L: 90º to the left.
  • R: 90º to the right.
Categories: PDF Tags: