PDF API: merge, split, rotate and compress
Merge several PDFs, extract pages, rotate and compress PDFs in the cloud with one endpoint.
Short answer
POST /api/v1/pdf-job/ with an operation of merge, split, rotate or compress. Pass sourceKeys (in order) for merge, or a single sourceKey for the others; split takes zero-based page numbers in "pages" and rotate takes "degrees" of 90, 180 or 270. Files come from a direct upload and the result is a new PDF job you poll like any other.
Operations
Files must already be in your account storage: upload them first and use the returned objectKey values.
| operation | Input | Extra fields |
|---|---|---|
| merge | sourceKeys: 2 or more PDFs, in order | — |
| split | sourceKey | pages: zero-based array, e.g. [0, 1, 4] keeps pages 1, 2 and 5 |
| rotate | sourceKey | degrees: 90, 180 or 270 |
| compress | sourceKey | — (Ghostscript "ebook" profile, 150 dpi images) |
Merge two uploaded PDFs
To merge PDFs that are already online, POST /api/v1/merge/ with a "files" array of 2–20 PDF URLs in order. It costs 1 credit and returns the merged PDF directly in the response instead of a job, which is convenient in no-code tools.
curl -X POST 'https://maxscanner.app/api/v1/pdf-job/' \
-H "Authorization: Bearer $MAXSCANNER_API_KEY" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: pack-8812-merge' \
-d '{ "operation": "merge", "filename": "pack.pdf", "sourceKeys": ["users/<id>/media/inbox/…-cover.pdf", "users/<id>/media/inbox/…-contract.pdf"] }'Limits and behaviour
Each input can be up to 100 MB and a job up to 150 MB in total. Compression rewrites images at about 150 dpi, which suits email and uploads; already small text PDFs may not shrink much. Encrypted PDFs must be unlocked first.
Frequently asked questions
Are page numbers zero-based?
In the API, yes: [0] is the first page. The website tools use 1-based numbers.
Can I compress to an exact size?
Not through this endpoint. It applies one balanced profile; the website has a compress-to-size tool for exact targets.