PDF page numbers
Page numbers is an API that adds numbering to a PDF that doesn't have any. Great for reports, contracts or dossiers generated from n8n, Make or Zapier, with no servers to maintain.
How it works
You send a PDF and get back the same PDF with a number added to every page, bottom-center by default. You can choose the position, the text format (just the number, or "3 of 10"), which number to start from, and which pages to number. Nothing is stored.
If you only select some pages (to skip a cover page, for example), numbering starts at the number you choose FROM the first selected page: it doesn't use that page's real position in the document.
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 numbered PDF back directly. In the HTTP Request node:
- Method:
POST - URL:
https://api.cofferdock.com/pdf-page-numbers - Send Query Parameters: on, and add whatever you want to change, e.g.
position=bottom-right(see the table for the rest). - 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
In Make (HTTP → Make a request module): same method and URL, options in Query String, the two headers, and the PDF as binary data in the body.
Options (as Query Parameters)
| Option | Default | What it does |
|---|---|---|
position | bottom-center | bottom-center, bottom-left, bottom-right, top-center, top-left, top-right. |
format | {n} | The number's text. Use {n} for the number and {total} for the page count, e.g. Page {n} of {total}. |
start | 1 | The number for the first numbered page. |
pages | all | Which pages to number, e.g. 2-10 to skip a cover page. |
API overview
- Endpoint:
POST https://api.cofferdock.com/pdf-page-numbers - 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 binary; with JSON it returns base64 inpdf. Addoutput=pdforoutput=jsonto force it. - 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 call = 1 credit.
Options
| Option | Default | Description |
|---|---|---|
position | bottom-center | 6 positions: combine top/bottom with left/center/right. |
format | {n} | Must include {n} (missing it → 400). {total} is optional and always refers to the document's total page count, not the number of selected pages. |
start | 1 | Integer, 0–100000. |
pages | all | 1-indexed range, e.g. 2-10. Numbering is SEQUENTIAL within the selection: the first selected page gets start, not its real position in the document. |
font_size | 10 | 6–72. |
color | #000000 | Hex. |
margin | 24 | Points (0–200) from the page edge. |
file | - | JSON mode only: the PDF in base64. |
output | per mode | pdf (binary) or json (base64). |
Examples
curl (raw PDF, "3 of 10" format):
curl -X POST "https://api.cofferdock.com/pdf-page-numbers?format=%7Bn%7D%20of%20%7Btotal%7D" \
-H "x-api-key: YOUR_KEY" \
-H "Content-Type: application/pdf" \
--data-binary @document.pdf \
-o numbered.pdf
JavaScript (Node 18+, skipping the cover page):
const fs = require('fs');
const params = new URLSearchParams({ pages: '2-10', start: '1', position: 'bottom-right' });
const r = await fetch(`https://api.cofferdock.com/pdf-page-numbers?${params}`, {
method: 'POST',
headers: { 'x-api-key': 'YOUR_KEY', 'Content-Type': 'application/pdf' },
body: fs.readFileSync('document.pdf'),
});
fs.writeFileSync('numbered.pdf', Buffer.from(await r.arrayBuffer()));
Python:
import requests
r = requests.post(
'https://api.cofferdock.com/pdf-page-numbers',
params={'format': '{n} of {total}', 'position': 'bottom-center'},
headers={'x-api-key': 'YOUR_KEY', 'Content-Type': 'application/pdf'},
data=open('document.pdf', 'rb').read(),
)
open('numbered.pdf', 'wb').write(r.content)
JSON mode (base64 response)
{ "file": "JVBERi0xLjQ…", "format": "{n}/{total}", "position": "bottom-right" }
→ { "success": true, "pdf": "JVBERi0xLjQ…", "mime_type": "application/pdf",
"meta": { "pages_numbered": 10, "format": "{n}/{total}", "total_pages": 10, "used": 12, "remaining": 488 } }
What you get back
The numbered PDF itself, ready to save or send. (In JSON mode, the PDF comes in base64.)