Rotate pages
rotate_pagesRotate all or selected PDF pages clockwise by 90, 180, or 270 degrees to correct sideways or upside-down scans, saving changes to a new PDF.
Instructions
Rotates every page, or the chosen pages, clockwise by 90, 180 or 270 degrees and writes the whole document to a new PDF. Use it for sideways or upside-down scans; page content is not altered, only its display rotation, which is added to any rotation the page already has. The original is not changed, and an existing output file is only replaced with overwrite: true. Fails with a message for an invalid page range and for encrypted PDFs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path of the PDF. | |
| pages | No | Pages as 1-based numbers and ranges, e.g. "1-3,5". All pages when omitted; a page outside the document is an error. | |
| output | Yes | Absolute path of the new PDF. If the file exists, the call fails unless overwrite is true. | |
| degrees | Yes | Clockwise turn added to the current rotation. | |
| password | No | Password, if the PDF is encrypted. Without it an encrypted PDF cannot be opened; with it, it can be read, but tools that write a new PDF cannot save it. | |
| overwrite | No | Allow replacing an existing file (default false). |