PythonClaw pdf_merge

Merge multiple PDF files into a single PDF. Use when: user asks to combine, join, or concatenate PDFs. Supports page selection and ordering. NOT for: splitting PDFs, editing content, 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_merge" ~/.claude/skills/ericwang915-pythonclaw-pdf-merge && rm -rf "$T"
manifest: pythonclaw/templates/skills/data/pdf_merge/SKILL.md
source content

PDF Merge Skill

Merge multiple PDF files into one combined document using PyPDF2.

When to Use

USE this skill when:

  • "Merge these PDFs together"
  • "Combine report1.pdf and report2.pdf"
  • "Join all PDFs in this folder"
  • "Append this PDF to the end of another"
  • User wants to create a single PDF from multiple source PDFs

When NOT to Use

DON'T use this skill when:

  • Splitting a single PDF → use
    pdf_split
  • Creating a PDF from text → use
    pdf_writer
  • Extracting text from PDF → use
    pdf_reader
  • Converting PDF to images → use
    pdf_convert

Usage/Commands

python {skill_path}/merge_pdf.py OUTPUT_PATH INPUT1 INPUT2 [INPUT3 ...] [options]

Options:

  • --pages "1:1-3,2:5-10"
    — select specific pages per input file (1-indexed, file_index:page_range)
  • --dir PATH
    — merge all PDFs in a directory (alphabetical order)
  • --reverse
    — reverse the input order
  • --format json
    — output result as JSON

Examples

  • "Merge a.pdf and b.pdf" →
    python {skill_path}/merge_pdf.py combined.pdf a.pdf b.pdf
  • "Merge all PDFs in reports/" →
    python {skill_path}/merge_pdf.py combined.pdf --dir reports/
  • "Combine only pages 1-3 of first and 5-10 of second" →
    python {skill_path}/merge_pdf.py out.pdf a.pdf b.pdf --pages "1:1-3,2:5-10"

Notes

  • Install dependency:
    pip install PyPDF2
  • Input files must be valid PDFs
  • Preserves bookmarks and links when possible