PDF split
Try it interactively →POST /api/pdf-splitSplit a PDF into smaller PDFs. Either one PDF per page, or arbitrary page ranges (`1-3,5,7-10`). Output is delivered as a ZIP of the resulting documents.
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| pdf* | file | — | PDF document bytes. |
| mode | enum (pages | ranges) | "pages" | `pages` for one PDF per source page; `ranges` to use the `ranges` parameter. |
| ranges | string | — | Comma-separated 1-indexed inclusive ranges (e.g. `1-3,5,7-9`). Required when mode=ranges. |
Response
Modes: json. Cache: yes (24h TTL).
Code samples
Built from the per-page example.
# Download or substitute the example input:
# curl -O https://xtract.bot/examples/pdf-split/hello.pdf
PDF=$(base64 -w0 < hello.pdf)
curl -X POST https://api.xtract.bot/api/pdf-split \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
-H "X-Api-Key: $XTRACT_API_KEY" \
-d '{
"mode": "pages",
"pdf": "'"$PDF"'"
}'