Inkspan › Guides › How to split a PDF into pages in cURL

How to split a PDF into pages in cURL

The /v1/pdf/split endpoint explodes a PDF into one file per page and returns them as a ZIP archive named pages.zip, containing page_1.pdf, page_2.pdf, and so on. This matters for pipelines that process documents a page at a time — per-page OCR, routing scanned batches, or extracting a signature page from a contract.

Note the response is a ZIP, not a PDF. This is the detail most often missed when wiring the endpoint up for the first time, because every other manipulation endpoint returns a PDF.

Also in: Python · Node.js

cURL example

curl -X POST https://api.inkspan.dev/v1/pdf/split \
  -H "X-API-Key: ink_live_..." \
  -F "file=@input.pdf" \
  --output pages.zip

Request parameters

NameTypeRequiredDescription
filefileyesThe PDF to split. One output file is produced per page.

Response

Returns a ZIP archive as a binary stream with Content-Type: application/zip and Content-Disposition: attachment; filename=pages.zip. Write the response body straight to disk — do not parse it as JSON.

Things that catch people out

Errors

StatusMeaningFix
401Invalid or missing API keySend your key in the X-API-Key header.
402Monthly quota exceededThe response reports used/quota. Upgrade at inkspan.dev/#pricing.
422Missing or invalid parameterCheck required fields in the table above — the body names the offending field.

Failed requests do not count against your quota; only successful ones are metered.

Frequently asked questions

Can I split on a range instead of every page?

Not directly. Split into pages and select the entries you need from the archive, or merge the ones you want back together.

What is the ZIP structure?

A flat archive with no directories — page_1.pdf, page_2.pdf, and so on, in document order.

Does this count as one document?

Yes. Quota is metered per request, not per page produced.

Get a free API key →

Related Manipulate guides: merge PDF files · compress a PDF · add a watermark to a PDF · convert a PDF to images · fill a PDF form