Split PDF
Split PDF is an API that separates a PDF into several, by the pages or ranges you specify. Great for pulling out chapters, attachments or loose pages from n8n, Make or Zapier, with no servers to maintain.
How it works
You send a PDF and a list of pages or ranges (for example 1-3,5,7-9) and you get back one PDF per range, all inside the same response. Nothing is stored: it's generated on the fly.
Since the result is several files at once, the response is always JSON with one base64 PDF per requested range (never a single binary PDF, even if you send the input PDF raw).
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).
- Knowing which pages you want (e.g.
1-3,5,7-9).
How to use it in n8n (step by step)
You send your PDF as is (as binary data, not text) and get the pieces back. In the HTTP Request node:
- Method:
POST - URL:
https://api.cofferdock.com/pdf-split - Send Query Parameters: on, and add
ranges=1-3,5,7-9 - 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", picking the binary property that carries your PDF from an earlier step, usually
data)
The response is a JSON with one base64 PDF per range. To save them as separate files you need one more step to decode each base64 (for example, a Code node with Buffer.from(item.pdf, 'base64') for each item in files).
In Make (HTTP → Make a request module): same method and URL, add ranges to Query String, the two headers in Headers, Body type: the PDF as binary data (Make offers this when you connect a module that already carries a file, like Google Drive or email).
In short: POST to …/pdf-split, ranges as a Query Parameter, the x-api-key and Content-Type: application/pdf headers, the PDF as binary Body. The response carries one base64 PDF per range.
Options (as Query Parameters)
| Option | Default | What it does |
|---|---|---|
ranges | - | Required. Pages or ranges separated by commas, 1 = first page. E.g. 1-3,5,7-9 produces 3 PDFs: pages 1 to 3, page 5 alone, and pages 7 to 9. |
API overview
- Endpoint:
POST https://api.cofferdock.com/pdf-split - Auth: header
x-api-key: YOUR_KEY. - Input: the PDF goes in the body as
application/pdf(raw, withrangesas a Query Parameter) or asapplication/jsonwith{ "file": "<base64>", "ranges": "…" }. - Output: ALWAYS JSON:
{ files: [{ range, pages, pdf, size_bytes }, …] }(there's no direct binary mode; the result is a set of files). - Limits: the input PDF accepts up to 20 MB (50 MB on Business/Scale plans) in
application/pdfmode; in JSON with base64, about 4 MB real. 30 requests/min per IP. 1 split = 1 credit, no matter how many ranges you request.
Options
| Option | Default | Description |
|---|---|---|
ranges | - | Required. E.g. 1-3,5,7-9 (1-indexed, inclusive). An invalid token or one outside the document's real page count → 400. |
file | - | JSON mode only: the PDF in base64. |
Examples
curl (raw PDF, saves the JSON response):
curl -X POST "https://api.cofferdock.com/pdf-split?ranges=1-3,5,7-9" \
-H "x-api-key: YOUR_KEY" \
-H "Content-Type: application/pdf" \
--data-binary @document.pdf \
-o result.json
JavaScript (Node 18+, saves each piece as a file):
const fs = require('fs');
const r = await fetch('https://api.cofferdock.com/pdf-split?ranges=1-3,5,7-9', {
method: 'POST',
headers: { 'x-api-key': 'YOUR_KEY', 'Content-Type': 'application/pdf' },
body: fs.readFileSync('document.pdf'),
});
const j = await r.json();
for (const f of j.files) fs.writeFileSync(`part-${f.range}.pdf`, Buffer.from(f.pdf, 'base64'));
Python:
import requests, base64
r = requests.post(
'https://api.cofferdock.com/pdf-split',
params={'ranges': '1-3,5,7-9'},
headers={'x-api-key': 'YOUR_KEY', 'Content-Type': 'application/pdf'},
data=open('document.pdf', 'rb').read(),
)
for f in r.json()['files']:
open(f'part-{f["range"]}.pdf', 'wb').write(base64.b64decode(f['pdf']))
Response shape
{ "success": true,
"files": [
{ "range": "1-3", "pages": [1,2,3], "pdf": "JVBERi0xLjQ…", "size_bytes": 12044 },
{ "range": "5", "pages": [5], "pdf": "JVBERi0xLjQ…", "size_bytes": 4021 },
{ "range": "7-9", "pages": [7,8,9], "pdf": "JVBERi0xLjQ…", "size_bytes": 9112 }
],
"meta": { "source_pages": 10, "files_created": 3, "used": 13, "remaining": 487 } }
What you get back
A JSON object with one base64 PDF per range you asked for, plus the total page count of the original document.