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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>",
"pages": "<pages>"
},
"name": "extract_pages"
}
}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 |