Extract PDF pages
extract_pdf_pagesCopies selected pages from a PDF into a new PDF in the order you specify, leaving the original unchanged. Use it to keep only the pages you need.
Instructions
Copy chosen pages of a PDF into one new PDF, in the order typed ("3, 1-2" puts page 3 first). Use this to keep some pages; to drop pages use delete_pdf_pages, and for many output files use split_pdf. Returns the saved path and page count. The input is not changed; give the password for an encrypted PDF.
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": {
"file": "<file>",
"pages": "<pages>"
},
"name": "extract_pdf_pages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Path to the file (absolute, or relative to the working directory). | |
| pages | Yes | Pages to keep, like "1-3, 8" (a trailing "-" means to the end). | |
| output | No | Where to save the result. Defaults to a new file next to the input. | |
| password | No | The PDF's current password, if it has one. |