Qpdf operation reference
Generated from the current declarations. Do not edit this file by hand.
Types, limits and defaults below describe resolved values. Runtime expressions must produce these types. Unknown options are rejected; defaults apply only when omitted. Constructor options must be constant after document composition.
Index#
assemble#
Build a new PDF from selected pages of one to four named PDFs. Choose the pages in the order you want them, repeat a page by listing it again, and turn any listed page clockwise by a quarter turn. Each PDF is captured before execution; after assembly the captured sources and the published PDF are reopened with QPDF and MuPDF and every output page must match its source page exactly in a 36 dpi raster, its text and its geometry. This is bounded page assembly, not a sanitiser or editor: document-level data such as bookmarks, links on selected pages, metadata and page labels is discarded or refused, and sources with forms, signatures, layers, tagged structure or encryption are refused.
Common mistakes and assumptions:
- Page numbers are the one-based physical position in the PDF, not the printed page label.
- Rotation is added to the page's own rotation; it does not set an absolute orientation.
- Bookmarks, named destinations, document information and page labels are not carried into the output.
- Pages with link or other annotations or a transparency group, and PDFs with forms or layers, are refused rather than altered.
- A PDF that QPDF has to repair is refused; supply an intact copy.
Native binding: qpdf --empty --pages FILE PAGE ... -- --rotate=+N:K --remove-page-labels --deterministic-id; MuPDF PDFDocument.findPage/PDFObject.put/getInheritable, PDFPage.getBounds/toPixmap/toStructuredText. Output kind: ["pdf","text"].
Inputs: none.
| Option | Meaning | Type / constraints | Default |
|---|---|---|---|
sources |
Required list of 1-4 source PDFs, each with a short name you choose and an absolute local path. Each file must be a regular, unencrypted PDF of at most 16 MiB (32 MiB together) with at most 500 pages. Every declared source must supply at least one page, and each path may be listed once; refer to a PDF by name from as many pages as you like. | {"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":24,"required":true},"path":{"type":"string","minLength":1,"maxLength":4096,"required":true}}},"minItems":1,"maxItems":4} |
required |
pages |
Required ordered list of 1-200 output pages. The output order is the list order. List a page again to repeat it; each repeat is an independent page and may carry its own rotation. The 36 dpi verification raster must fit 4096 pixels per side and 16,777,216 pixels over all output pages including repeats, so large pages limit how many fit; physical page sides must be at most 8192 points including UserUnit. | {"type":"array","items":{"type":"object","properties":{"source":{"type":"string","minLength":1,"maxLength":24,"required":true},"page":{"type":"integer","minimum":1,"maximum":500,"required":true},"rotate":{"type":"enum","values":[0,90,180,270],"default":0}}},"minItems":1,"maxItems":200} |
required |