Extract Pages
extract_pagesExtract selected pages from a PDF into a new file, preserving or reordering them as specified; output can be saved or returned as base64.
Instructions
Create a new PDF containing only the given pages. The given order is preserved, so extraction doubles as reordering. Pages are copied into a new document, so document-level information (tagged structure, XMP, attachments, AcroForm, bookmarks, etc.) is not carried over. Anything lost is reported in warnings; follow up on the output with attach_file / ensure_tagged / add_bookmarks / set_metadata as needed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pages | Yes | Pages to extract, "1,3-5,8-" (1-based). The given order becomes the output order. | |
| inputPath | Yes | Absolute path of the target PDF. | |
| outputPath | No | Destination file path (absolute). When omitted, a base64 string is returned instead. | |
| returnBase64 | No | When true, include a base64 string in the result in addition to saving. | |
| allowBreakingSignatures | No | When the target is digitally signed (detected via /ByteRange), the default is an error. Set true to proceed, accepting that the signatures become invalid. |