Delete Pages
delete_pagesRemove specified pages from a PDF and save a new file. Reports lost document-level data so you can restore bookmarks, metadata, or form fields as needed.
Instructions
Create a new PDF with the given pages removed. Deleting every page is an error. 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 delete, "1,3-5,8-" (1-based). | |
| 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. |