Extract, reorder or delete PDF pages
extract_pdf_pagesCreate a new PDF containing only selected pages in your chosen order. Extract ranges, reorder pages, or keep a subset without changing the original file.
Instructions
Write a new PDF containing only the listed pages, in the listed order. Use it to pull out a range, reorder pages ("3,1,2") or drop pages (list the ones to keep). Pages are 1-based; ranges like "1-3, 7" and reversed ranges like "5-1" work. Writes a new PDF and returns its path; the input is not modified and an existing file is never overwritten. To cut a PDF into equal parts use split_pdf instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | Path to the PDF. | |
| pages | Yes | Pages to keep, for example "1-3, 7" or "3,1,2". | |
| output | No | Where to write the result. Defaults to a new file beside the input. Existing files are never overwritten; a free name like file-1.pdf is used instead. | |
| password | No | Password for a PDF that asks for one when opened. Used only on this machine. |