Reorder Pages
reorder_pagesRearrange PDF pages by providing a new 1-based page sequence. Copies pages into a new document and reports lost metadata, bookmarks, or forms for follow-up.
Instructions
Reorder pages. order must list every page exactly once, in the new order. 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 |
|---|---|---|---|
| order | Yes | New page order (1-based). Example: [5,4,3,2,1] reverses a 5-page document. | |
| 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. |