PDFDispatch Docs

Split PDFs

Cut a PDF into parts every few pages, or take out the pages you choose.

POST https://api.pdfdispatch.com/v1/pdf/split

Form fields

FieldTypeDefaultWhat it does
files requiredfile(s)–The PDFs to split.
splitMode requiredstring–intervals: a new file every splitSpan pages. pages: take the pages in splitSpan.
splitSpan requiredstring–For intervals, a number of pages (2: pages 1-2, 3-4, …). For pages, a selection: 1-3, 5, 7- (7 to the end), even, odd, !2 (all but 2), joined with commas.
splitUnifybooleanfalsepages mode only: put the selected pages into one PDF instead of one file per page.
flattenbooleanfalseFlatten form fields and annotations of the parts.

And the options on conversion routes, applied to each part. splitMode and splitSpan also work on the conversion routes themselves: convert a long document and get it in parts.

What comes back

  • intervals, or pages without splitUnify: a ZIP. The parts are named after the input with a number: report_0.pdf, report_1.pdf, …
  • pages with splitUnify=true: one PDF with the selected pages.

Examples

Every two pages into a file of their own:

curl --fail-with-body \
  --header "Authorization: Bearer $PDD_KEY" \
  --form files=@tickets.pdf \
  --form splitMode=intervals \
  --form splitSpan=2 \
  --output tickets.zip \
  https://api.pdfdispatch.com/v1/pdf/split

The first page and pages 4 to 6, as one PDF:

curl --fail-with-body \
  --header "Authorization: Bearer $PDD_KEY" \
  --form files=@contract.pdf \
  --form splitMode=pages \
  --form splitSpan=1,4-6 \
  --form splitUnify=true \
  --output excerpt.pdf \
  https://api.pdfdispatch.com/v1/pdf/split