PythonClaw pdf_convert
Convert between PDF and image formats. Use when: user asks to convert PDF pages to images (PNG/JPEG) or combine images into a PDF. NOT for: text extraction (use pdf_reader), PDF editing, or document format conversion (DOCX/HTML).
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_convert" ~/.claude/skills/ericwang915-pythonclaw-pdf-convert && rm -rf "$T"
manifest:
pythonclaw/templates/skills/data/pdf_convert/SKILL.mdsource content
PDF Convert Skill
Convert PDF pages to images or combine images into a PDF.
When to Use
✅ USE this skill when:
- "Convert this PDF to images"
- "Save page 3 as a PNG"
- "Make a PDF from these images"
- "Export PDF pages as JPEG"
- User wants to convert between PDF and image formats
When NOT to Use
❌ DON'T use this skill when:
- Extracting text from PDF → use
pdf_reader - Creating PDF from text/markdown → use
pdf_writer - Converting to DOCX, HTML, etc. → use specialized converters
- Merging PDFs → use
pdf_merge
Usage/Commands
Images to PDF
python {skill_path}/convert_pdf.py to-pdf OUTPUT_PDF IMAGE1 IMAGE2 [IMAGE3 ...] [options]
Options:
— use all images from a directory--dir PATH
— fit images to page (default: actual size with margins)--fit
— page size (default: A4)--page-size A4|letter
PDF to Images
python {skill_path}/convert_pdf.py to-images INPUT_PDF [options]
Options:
— specific pages (default: all)--pages "1-5"
— output directory (default: same as input)--output DIR
— image format (default: png)--img-format png|jpeg
— resolution (default: 150)--dpi 150
Examples
- "Convert PDF to PNGs" →
python {skill_path}/convert_pdf.py to-images doc.pdf --output ./images/ - "Make PDF from images" →
python {skill_path}/convert_pdf.py to-pdf album.pdf img1.png img2.jpg - "Page 3 as JPEG" →
python {skill_path}/convert_pdf.py to-images doc.pdf --pages 3 --img-format jpeg
Notes
- Install dependencies:
pip install PyPDF2 Pillow
requires a PDF rendering library; falls back to a placeholder if pdf2image/poppler is unavailableto-images- Supported image inputs: PNG, JPEG, BMP, TIFF, GIF