Rotate Document
Organize → Rotate Document
The Rotate Document API rotates all pages in a PDF by the same amount. You send the PDF (docContent Base64, docName), rotationType (NoRotation, Clockwise, CounterClockwise, UpsideDown), and optionally async. The API returns the PDF with all pages rotated. Use the tester below to try it; more details are in the sections that follow.
Try the Rotate Document API
:::note Quick reference
Endpoint: POST /api/v2/Rotate · Required: api-key, docContent, docName, rotationType
:::
:::info Try it live Use the form below to send your API key, PDF (Base64), and rotation (e.g. Clockwise, UpsideDown). The response is the PDF with all pages rotated. No code required—fill the fields and click Send request. :::
Overview, parameters, and use cases
- Overview
- Parameters
- Use cases
What is Rotate Document?
This endpoint rotates all pages in a PDF by the same amount. You choose rotationType: NoRotation, Clockwise (90°), CounterClockwise (90°), or UpsideDown (180°). The API returns the PDF with every page rotated. Use it when the whole document was scanned or captured in the wrong orientation.
Rotation types
- NoRotation – No rotation applied.
- Clockwise – Rotate 90° clockwise.
- CounterClockwise – Rotate 90° counter-clockwise.
- UpsideDown – Rotate 180°.
:::tip Best for Use when all pages need the same rotation. For rotating only specific pages use Rotate Page. :::
API parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| api-key | string | Yes | Your PDF4me API key, Base64 encoded. Get it from the dashboard. |
| docContent | base64 | Yes | PDF file content (Base64). |
| docName | string | Yes | Output PDF file name (e.g. output.pdf). |
| rotationType | string | Yes | NoRotation, Clockwise, CounterClockwise, or UpsideDown. |
| async | boolean | No | Enable asynchronous processing. |
When to use Rotate Document
- Scanned documents – Rotate all pages when the whole document was scanned sideways or upside down.
- Orientation correction – Fix orientation for all pages in one call.
- Batch normalization – Ensure all pages have the same rotation before distribution.
:::info Need the full API? For request/response schemas and code samples, see Rotate Document in the PDF4me API docs. :::
Prerequisites
Before using this endpoint, make sure you have:
- A valid PDF4me API key (Get your API Key)
- A PDF file in Base64 format
Response Format
The API returns a PDF file with all pages rotated according to the specified rotation type.