Extract pages
extract_pagesExtract selected pages from a PDF into a new file, preserving page order while leaving the original unchanged. Specify pages like "1-3, 5" or "4-end" and optionally an output path.
Instructions
Copies the selected pages into one new PDF, in page order, named with -pages. Writes the result as a new file next to the input (or to output_path) and never replaces an existing file; the input is left unchanged.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to a PDF file, or one starting with ~/. | |
| pages | Yes | Pages, such as "2", "1-3, 5" or "4-end". Commas separate parts. | |
| output_path | No | Optional absolute path for the new PDF, ending in .pdf. It must not exist yet. By default the result goes next to the input. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pages | Yes | Pages in the new PDF | |
| output_path | Yes | Where the new PDF was written |