Rotate PDFs
Rotates pages of one or more PDF files by a given angle. You can target all pages or specific page ranges.
POST/forms/pdfengines/rotate
Headers
Gotenberg-Output-Filenamestring
The filename of the resulting file - Gotenberg automatically appends the file extension. Defaults to a random UUID filename.
Gotenberg-Tracestring
A custom request ID to identify the request in the logs; overrides the default UUID.
Form Fields
rotateAngleenumrequired
The rotation angle. Options: '90', '180', '270'.
rotatePagesstring
Page ranges to rotate (e.g., '1-3', '5'). Empty means all pages.
Form Files
filesfile[]required
PDF files to rotate.
Example Request
cURL
curl \
--request POST http://localhost:3000/forms/pdfengines/rotate \
--form files=@/path/to/file.pdf \
--form rotateAngle=90 \
-o my.pdf
Responses
- 200
- 400
- 503
The rotated PDF file.
Content-Disposition: attachment; filename={output-filename.pdf}
Content-Type: {content-type}
Content-Length: {content-length}
Gotenberg-Trace: {trace}
Body: {output-file}
The request had one ore more invalid form fields.
Content-Type: text/plain; charset=UTF-8
Gotenberg-Trace: {trace}
Body: {error}
The request did not complete within the configured maximum duration.
Content-Type: text/plain; charset=UTF-8
Gotenberg-Trace: {trace}
Body: Service Unavailable
