xtract.bot
POST /api/pdf-split

Split 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.

Splits a PDF into multiple smaller PDFs. Two modes: - `every-page` (default): output one PDF per page, named `page-001.pdf`, `page-002.pdf`, … - `ranges`: supply explicit page ranges (e.g. `1-3,5,7-10`); each range becomes a separate PDF. The result is delivered as a ZIP archive containing the split PDFs.

Inputs

NameTypeDefaultDescription
pdf*filePDF document bytes.
modeenum (pages | ranges)"pages"`pages` for one PDF per source page; `ranges` to use the `ranges` parameter.
rangesstringComma-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"'"
}'