Extract PDF pages
extract_pdf_pagesExtract selected pages from a local PDF into a new file, keeping the original unchanged. Specify pages by list or range (e.g., 1-3,7,10-12) and preserve order in the output.
Instructions
Write a selection of pages from a local PDF into a new file, leaving the original untouched. Pages are 1-based and may be given as a list and ranges, e.g. "1-3,7,10-12". Order is preserved, so "3,1" produces a two-page file in that order.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pages | Yes | 1-based page selection, e.g. "1-3,7,10-12". Ranges may descend ("5-1"). | |
| inputPath | Yes | The PDF to take pages from. Absolute, or relative to the client's working directory. | |
| overwrite | No | Replace outputPath if a file is already there. | |
| outputPath | Yes | Where to write the extracted pages. Absolute, or relative to the client's working directory. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pageCount | Yes | ||
| sizeBytes | Yes | ||
| outputPath | Yes | ||
| sourcePages | Yes | The 1-based source pages, in output order. |