How to rotate selected pages in a PDF
Use the PDF rotator to turn every page or only selected one-based pages by a chosen angle. It returns a processed PDF with the normalized angle and page counts.
What this PDF rotator does
PDF pages can be rotated as a group or selectively when only a few pages have the wrong orientation. This is useful for correcting scanned pages, landscape inserts, or pages that were combined with inconsistent rotation. The tool accepts a PDF file as base64-encoded input, applies an angle, and produces a processed PDF result. If you do not specify an angle, the default is 90 degrees. ()
How to rotate PDF pages
- Prepare the PDF you want to change. Supply the file as base64-encoded data in the file input.
- Choose an angle. If you omit it, the tool uses 90 degrees. Supplied angles are normalized modulo 360, so the reported angle may differ from the number you entered after normalization.
- Choose which pages to rotate. Leave the pages setting as
allto rotate every page. For a selection, enter comma-separated, one-based page numbers such as2,5,11. Only valid page numbers within the document are rotated. Repeated page numbers count once, and page numbers beyond the document length are ignored. - Run the operation and inspect the result. A successful response contains a base64-encoded PDF, the normalized angle, the total page count, and the number of rotated pages.
- If you selected specific pages, remember that the other pages remain in the resulting PDF; they are included without the requested rotation. Save or decode the returned PDF using the handling process available in your workflow.
Use individual page numbers rather than page ranges. A non-integer page token can cause the operation to fail, so check the list before submitting it. The operation can also fail if no file is supplied or if an exception occurs while decoding, reading, selecting, rotating, or writing the PDF. ()
How to read the result
Read the returned counts together with the normalized angle. The total page count describes the PDF that was processed, while the rotated-page count shows how many pages received the rotation. With all, those counts should represent every page being selected for rotation. With a page list, the rotated count reflects valid, in-range pages after duplicate selections are counted once; out-of-range numbers do not increase it.
A selective rotation does not extract pages or remove the unselected ones. The output remains a PDF containing the document's pages, with the requested rotation applied only to the valid selected pages. For example, a 12-page file submitted with pages 2,5,11 and a 90-degree angle should return a result shaped like a base64-encoded PDF with a normalized angle of 90, a total-page count of 12, and a rotated-page count of 3, assuming those pages exist. ()
Worked example
A 12-page PDF has three pages that need a quarter-turn, so pages 2, 5, and 11 are selected for rotation.
Submit the 12-page PDF with an angle of 90 and the page selection 2,5,11.
A successful result contains a base64-encoded PDF, a normalized angle of 90, a total page count of 12, and a rotated-page count of 3.
Limitations
- Page selection is limited to comma-separated individual integer page numbers. Page ranges are not supported by the reviewed behavior, and a non-integer token can cause the operation to fail.
Common errors
- No file is provided or the file data is not supplied in the expected base64-encoded form. Provide the PDF file input and submit it again.
- A page selection contains a non-integer token, such as a range or text mixed into the list. Use comma-separated individual one-based page numbers, such as
2,5,11. - A selected page number is outside the document. Check the PDF's page count; out-of-range numbers are ignored, so they do not contribute to the rotated-page count.
FAQ
Can I rotate only certain pages in a PDF?
If you leave the pages setting as all, every page is rotated. If you provide a comma-separated list, only valid, in-range selected pages are rotated and the remaining pages stay in the output PDF.
What angle does the PDF rotator use?
The default is 90 degrees. Other supplied angles are accepted and normalized modulo 360 before rotation.
Can I enter a page range such as 2-5?
A non-integer page token can cause failure. Use individual comma-separated one-based page numbers rather than a range or another selection format.