Dictionary

What Is Page Rotation?

Page Rotation is the PDF value that tells a viewer how many degrees to turn a page clockwise when showing or printing it.

page-rotation

Page rotation is a value in a PDF file that tells a viewer how many degrees to turn a page clockwise. The viewer applies the turn when it shows the page on screen and when it prints the page.

The value is an instruction, not a change to the page itself. The text and pictures stay as they are stored, and the viewer turns the whole page. In a report from the pdfinfo program, the field appears in short form as Page rot.

Which files carry it

Only PDF documents carry this field. The format has stored it since PDF version 1.0, as an entry named Rotate in the description of each page.

Each page can have its own entry, so one document can mix pages with different values. The entry can also sit higher up in the file, on a group of pages that contains the page.

A page without its own entry takes the value from the nearest group that has one. If neither the page nor any group above it has an entry, the default is 0.

Photos use a different field for the same idea. A JPG image stores its turn in the Exif Orientation tag, as a number from 1 to 8.

What the values look like

The PDF format allows 0 or any other multiple of 90. Adobe Acrobat and the PDF interface of Windows both work with these 4 values:

  • 0: no turn, so the page appears as it is stored
  • 90: a quarter turn clockwise
  • 180: a half turn, so the page appears upside down
  • 270: 3 quarter turns clockwise, which ends in the same position as a quarter turn counterclockwise

A file can also store a negative number, such as -90, for a turn counterclockwise. Apple PDFKit changes -90 to its positive form, 270.

Poppler, the software behind pdfinfo, also adds 360 to a negative value. A pdfinfo report therefore shows 270, not -90.

Where the value comes from

The program that creates or edits the PDF writes the value. When you rotate a page in a PDF editor, the editor can store the turn in this field. The page content itself then stays the same.

In Adobe Acrobat, the scripting commands that read and set the rotation of a page use the same 4 values. Not every metadata reader shows the field. The list of PDF tags in ExifTool, for example, has no entry for page rotation.

Why it matters for your file

By default, pdfinfo reports the size and rotation of the first page only. A single Page Rotation value in a report can therefore describe page 1 only, while later pages have other values. pdfinfo prints a separate rotation line for each page when you give it a range of pages.

The value also explains why Page Size can look wrong. pdfinfo reports the size of the page before the turn.

For example, a Letter page measures 612 x 792 pts, which is about 21.6 x 27.9 cm. With a rotation of 90, this page is taller than it is wide in the file. On screen, the same page appears in landscape.

When a page appears sideways, the value helps you find the cause. A value of 90 or 270 means the file asks the viewer to turn the page. A value of 0 points to content that is sideways in the file itself.