Rotate PDF pages
Rotate pages is an API that turns the pages of a PDF 90, 180 or 270 degrees, all of them or just the ones you pick. Great for fixing sideways scans from n8n, Make or Zapier, with no servers to maintain.
How it works
You send a PDF and a rotation angle, and get back the same PDF with its pages rotated. By default it rotates every page 90°, but you can choose the angle and just some pages. Nothing is stored: it's generated on the fly.
The rotation is added to whatever a page already had (if a page was already rotated 90° and you ask for another 90°, it ends at 180°): the intuitive "rotate it a bit more" behavior.
All you need
- Your API key. Create it in your dashboard with "+ Create key". It's shown only once, so copy and save it.
- In your automation platform, an "HTTP Request" step (n8n, Make, Zapier, Pipedream… all have one).
How to use it in n8n (step by step)
You send your PDF as is (as binary data) and get the rotated PDF back directly. In the HTTP Request node:
- Method:
POST - URL:
https://api.cofferdock.com/pdf-rotate - Send Query Parameters: on, and add
angle=90(andpagesif you only want to rotate some, see the table). - Send Headers: on → add two:
x-api-key= your key, andContent-Type=application/pdf - Send Body: on → choose the binary file option (in n8n: "n8n Binary File", with your PDF's binary property, usually
data) - Under Options → Response → Response Format: choose File
The node's output is already the rotated PDF as a file: connect it straight to Drive, email, Telegram…
In Make (HTTP → Make a request module): same method and URL, add angle to Query String, the two headers in Headers, and the PDF as binary data in the body.
In short: POST to …/pdf-rotate, angle (and optionally pages) as Query Parameters, the x-api-key and Content-Type: application/pdf headers, the PDF as binary Body, Response Format as File.
Options (as Query Parameters)
| Option | Default | What it does |
|---|---|---|
angle | 90 | Rotation in degrees: 90, 180 or 270 (0 is also valid and rotates nothing). |
pages | all | Which pages to rotate, e.g. 1-3,5. Omit it to rotate the whole PDF. |
API overview
- Endpoint:
POST https://api.cofferdock.com/pdf-rotate - Auth: header
x-api-key: YOUR_KEY. - Input: the PDF goes in the body as
application/pdf(raw) or asapplication/jsonwith{ "file": "<base64>", ... }. - Output: by default, with
application/pdfit returns the rotated binary; with JSON it returns base64 in thepdffield. Addoutput=pdfto force the binary, oroutput=jsonto force base64. - Rotation: it's ADDED to whatever each page already had, not absolute.
- Limits: input PDF up to 20 MB (50 MB on Business/Scale) in
application/pdfmode, or ~4 MB real in JSON with base64. 30 requests/min per IP. 1 rotation = 1 credit.
Options
| Option | Default | Description |
|---|---|---|
angle | 90 | Multiple of 90: 0, 90, 180 or 270. Any other value → 400 (no silent rounding). |
pages | all | 1-indexed range, e.g. 1-3,5. Outside the document's real page count → 400. |
file | - | JSON mode only: the PDF in base64. |
output | per mode | pdf (binary) or json (base64). |
Examples
curl (raw PDF, saves the rotated PDF):
curl -X POST "https://api.cofferdock.com/pdf-rotate?angle=90&pages=1-3" \
-H "x-api-key: YOUR_KEY" \
-H "Content-Type: application/pdf" \
--data-binary @document.pdf \
-o rotated.pdf
JavaScript (Node 18+):
const fs = require('fs');
const r = await fetch('https://api.cofferdock.com/pdf-rotate?angle=180', {
method: 'POST',
headers: { 'x-api-key': 'YOUR_KEY', 'Content-Type': 'application/pdf' },
body: fs.readFileSync('document.pdf'),
});
const buffer = Buffer.from(await r.arrayBuffer());
fs.writeFileSync('rotated.pdf', buffer);
Python:
import requests
r = requests.post(
'https://api.cofferdock.com/pdf-rotate',
params={'angle': 180},
headers={'x-api-key': 'YOUR_KEY', 'Content-Type': 'application/pdf'},
data=open('document.pdf', 'rb').read(),
)
open('rotated.pdf', 'wb').write(r.content)
JSON mode (base64 response)
With Content-Type: application/json, the PDF goes in file (base64) and the options in the same object:
{ "file": "JVBERi0xLjQ…", "angle": 90, "pages": "1-3" }
→ { "success": true, "pdf": "JVBERi0xLjQ…", "mime_type": "application/pdf",
"meta": { "pages_rotated": 3, "angle": 90, "total_pages": 10, "used": 12, "remaining": 488 } }
What you get back
The rotated PDF itself, ready to save or send. (In JSON mode, the PDF comes in base64.)