PDFCraft
Render option

Render only some pages of a document to PDF

Subset of pages to keep, e.g. "1-5" or "1,4,7-9". Empty means all pages.

Fieldoptions.pageRanges
Typestring, up to 100 characters matching ^[0-9,\-\s]+$
Defaultnone

What it is for

Keeps a subset of pages: "1-5", "2", "1,4,7-9". Empty means every page.

The trap

Applied after the whole document is laid out, not instead of laying it out. Asking for page 3 of a 400-page document costs the same as rendering all 400 — it is a trimming step, not a shortcut.

Example

curl -X POST https://api.pdfcraft.dev/v1/render \
  -H "Authorization: Bearer $PDFCRAFT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "html": "<h1>hello</h1>",
    "options": {
      "pageRanges": "1-2"
    }
  }' \
  --output out.pdf

Every option

Try any of these in the playground without writing a line of code, or read the full reference.