fenix-skills/skills/extract-pdf-pages/SKILL.md

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):

  1. Source PDF — absolute path to the input PDF file
  2. Page range — start and end pages (e.g., 200-204)
  3. 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 pdftk to be installed (apt install pdftk).