Page Number in the Wrong Position on Rotated PDF Pages: Causes and Fix

Last updated

A page number lands in the wrong position on a rotated PDF when a tool draws in the page's unrotated coordinates; Add Page Numbers instead reads each page's stored rotation and places the label in the corner you see on screen.

The label turns with the page too, so it reads upright on portrait, landscape and upside-down pages alike.

Add Page Numbers

Why a Page Number Ends Up in the Wrong Position on a Rotated PDF

A PDF page can carry a rotation that viewers apply when they display it. pdf-lib's reference describes it as an angle in degrees that is always a multiple of 90. PDFPage class reference (pdf-lib documentation)

Our tool measures the visible page from its crop box, and for pages turned 90 or 270 degrees it swaps width and height before working out top, bottom, left and right.

pdf-lib's reference defines the crop box as the region the page contents are clipped to when displayed or printed, which is why that's the box we measure. PDFPage class reference (pdf-lib documentation)

On a page turned 180 degrees, bottom right as you see it sits at the top left of the unrotated page, so that's where the label goes.

Number a Rotated PDF in the Right Corner

Open Add Page Numbers and upload the PDF with mixed portrait and landscape pages.

Select Choose numbering options and pick the corner you want, such as Bottom right.

Select Add Page Numbers and download the result.

Scroll through the PDF and check one rotated page and one upright page.

Labels keep a fixed 24 point gap from the top or bottom edge of the page as it's displayed, and corner positions keep the same gap from the side.

Add Page Numbers options set to Bottom right, which avoids a page number in the wrong position on a rotated PDF
The options screen with Bottom right chosen as the position.

What We Measured on Turned and Cropped Pages

To see it for ourselves, in October 2026 we turned page 1 of a 4-page Letter test file 90 degrees and page 2 180 degrees with the pdf-lib calls Rotate PDF Pages makes. Then we cropped page 3 and numbered the file with Bottom right.

On the page turned 90 degrees the viewer shows a 792 by 612 point landscape page. The label sat 24 points from its right edge and read upright, while the original text ran sideways.

On the upside-down page the label sat at the bottom right as displayed, and the footer the file already had now showed up at the top of the page.

Page 3 had a crop box 72 points inside each edge, so it showed as 468 by 648 points. Its label sat 24 points inside that visible area rather than the full page.

Bates Numbers and Watermarks on the Same Rotated Pages

Bates Numbering places its labels the same way. On our turned and cropped test file, DOC001 to DOC004 sat at the bottom right as displayed, 24 points from the right edge, and read upright.

On the cropped page the Bates label stayed inside the visible crop box, just like the page number.

Add Watermark centred DRAFT on each page as displayed, and it read upright on the pages turned 90 and 180 degrees as well.

When the Number Still Looks Out of Place

A page with a rotation other than 0, 90, 180 or 270 degrees stops the job with an unsupported rotation error.

Rotate sideways scans to upright with Rotate PDF before numbering, so the label follows the reading direction.

Check the original file in a second viewer if one program shows the page turned differently.

Continue with Add Page Numbers to Multiple PDFs at Once by Merging First or PDF Still Sideways After Rotating: Causes and Fixes.

Frequently Asked Questions about Page Number in the Wrong Position on Rotated PDF Pages: Causes and Fix

Does Add Page Numbers rotate my pages?

No. The tool only reads each page's rotation to place the label, and it never changes it.

Where does the label go on a landscape page?

A landscape page gets measured as wide and short, so Bottom right lands in the lower right corner of the page as you read it.

Which positions can I choose?

Six: top left, top center, top right, bottom left, bottom center and bottom right.

Can I number only the landscape pages?

No. Every page in the file gets a label, portrait or landscape alike.