1.1 KiB
1.1 KiB
| name | description | tools | disable-model-invocation |
|---|---|---|---|
| extract-pdf-pages | Use when the user invokes "/extract-pdf-pages" to extract a page range from a PDF file using pdftk. | Bash | true |
Extract PDF Pages
Extract a page range from a PDF file into a new PDF using pdftk.
Usage
When invoked, ask the user for (if not already provided):
- Source PDF — absolute path to the input PDF file
- Page range — start and end pages (e.g.,
200-204) - Output filename — name for the new PDF (defaults to current working directory)
Command
pdftk "<source_pdf>" cat <start>-<end> output "<output_path>"
Rules
- Always use absolute paths for both source and output files.
- If the user provides only a filename (no directory), place the output in the current working directory.
- If the output file already exists, warn the user before overwriting.
- Support multiple extractions in a single invocation (run them in parallel).
- After extraction, confirm with file size:
ls -lh "<output_path>" - Requires
pdftkto be installed (apt install pdftk).