Skip to content

Selecting pages & capping large PDFs

OCR and extraction cost scale with pages. You rarely need every page of a long PDF, so the platform lets you select pages per document and cap large PDFs across a whole batch.

On New document (/documents/new) the Pages control offers:

  • All pages — the default.
  • First N pages1-N.
  • First N pages + last page1-N,last. The last token resolves to the document’s final page server-side, so you don’t need to know the page count.
  • Custom — a print-style spec like 1-3, 5, 12-14, last.

The selection becomes the page_range form field on POST /v1/documents. The PDF page limit applies to the selected count, so a range pulls a few pages out of a very large PDF. Original page numbers are preserved on the result (canonical.pages[].source_page_number).

On New batch (/batches/new) Page handling applies to every file:

  • All pages.
  • Cap large PDFsfirst N pages + last page, for PDFs over M pages. Each file is expanded individually from its own page count: a 400-page PDF becomes 1-N,last; a 12-page PDF runs in full. This is the one-control way to keep a heterogeneous batch cheap — set it once and submit.
  • Same page range for every file (uploads only) — one print-style spec applied uniformly.

Cap large PDFs sends a page_cap_policy ({over_pages, first_pages, include_last}); the uniform range sends page_range. They are mutually exclusive. The cap policy also applies to source-pull batches — it is expanded as each remote file is discovered.

page_range is comma-separated, 1-indexed, case-insensitive:

SpecPages
all / empty / omittedevery page
1-3,5,12-141,2,3,5,12,13,14
lastthe final page
1-10,lastfirst 10 + the last page

A spec that lands entirely outside the document is a 400; a spec that partly overshoots is clamped, the way a printer would.