PythonClaw pdf_split
Split a PDF into separate files by page ranges. Use when: user asks to split, extract pages from, or break apart a PDF. Supports extracting single pages, ranges, or every-N-pages splitting. NOT for: merging PDFs, reading text, or converting formats.
install
source · Clone the upstream repo
git clone https://github.com/ericwang915/PythonClaw
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ericwang915/PythonClaw "$T" && mkdir -p ~/.claude/skills && cp -r "$T/pythonclaw/templates/skills/data/pdf_split" ~/.claude/skills/ericwang915-pythonclaw-pdf-split && rm -rf "$T"
manifest:
pythonclaw/templates/skills/data/pdf_split/SKILL.mdsource content
PDF Split Skill
Split a PDF file into multiple smaller PDFs by page ranges.
When to Use
✅ USE this skill when:
- "Split this PDF into individual pages"
- "Extract pages 5-10 from report.pdf"
- "Break this PDF into 3 parts"
- "Get page 7 as a separate PDF"
- User wants to extract or separate pages from a PDF
When NOT to Use
❌ DON'T use this skill when:
- Merging multiple PDFs → use
pdf_merge - Reading/extracting text → use
pdf_reader - Creating new PDFs → use
pdf_writer - Converting to images → use
pdf_convert
Usage/Commands
python {skill_path}/split_pdf.py INPUT_PDF [options]
Options:
— extract a specific page range to a single output file--pages "1-5"
— split into one PDF per page--each
— split into chunks of N pages each--every N
— output directory (default: same as input)--output DIR
— filename prefix for output files (default: input filename)--prefix NAME
— output result as JSON--format json
Examples
- "Extract pages 5-10" →
python {skill_path}/split_pdf.py doc.pdf --pages 5-10 - "Split into individual pages" →
python {skill_path}/split_pdf.py doc.pdf --each - "Split into chunks of 5 pages" →
python {skill_path}/split_pdf.py doc.pdf --every 5 --output ./parts/ - "Get page 3" →
python {skill_path}/split_pdf.py doc.pdf --pages 3
Notes
- Install dependency:
pip install PyPDF2 - Page numbers are 1-indexed
- Output files are named
{prefix}_p{start}-{end}.pdf