pdf

Extract, create, merge, split, and fill PDF documents using Python libraries and command-line tools.

Updated Jul 30, 2026
One-click install
npx skills add https://github.com/johsquaree/claude-basic-docs --skill pdf-johsquaree
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pdf
Source: https://github.com/johsquaree/claude-basic-docs/tree/main/.claude/skills/document-skills/pdf
Command: npx skills add https://github.com/johsquaree/claude-basic-docs --skill pdf-johsquaree

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pypdf, pdf2image, Pillow, and includes scripts (resource) and references (resource) components.

What problem does it solve? Working with PDF files programmatically is fragmented across many libraries and tools, and tasks like filling forms, extracting tables, or merging documents each require different approaches. This Skill consolidates PDF manipulation into one toolkit with ready-to-use code patterns and scripts. ## Core Features & Use Cases - Text and Table Extraction: Pull text and structured tables from PDFs using pdfplumber and pypdf, including OCR support for scanned documents. - PDF Creation and Manipulation: Generate new PDFs with reportlab, merge and split documents, rotate pages, add watermarks, and manage encryption. - Automated Form Filling: Fill both fillable and non-fillable PDF forms using dedicated scripts that detect fields, validate bounding boxes, and write annotations. - Use Case: Given a stack of non-fillable PDF application forms, convert pages to images, identify field locations visually, validate bounding boxes, and produce completed PDFs with text annotations. ## Quick Start Use the pdf skill to extract all tables from the attached report.pdf and save them to an Excel file.

Frequently Asked Questions about pdf

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract tables from a PDF in Python?

Use pdfplumber's page.extract_tables() method to detect and extract tables from each PDF page. The results can be loaded into pandas DataFrames and exported to Excel or CSV for further analysis.

How do I fill a PDF form programmatically?

First run check_fillable_fields.py to detect fillable fields. For fillable PDFs, extract field info to JSON and use fill_fillable_fields.py with your values. For non-fillable PDFs, convert pages to images, define bounding boxes in fields.json, validate them, and add text annotations.

Which Python library should I use for PDF text extraction?

Use pdfplumber when you need layout-aware text or table extraction, and pypdf for basic text, metadata, merging, and splitting. For scanned PDFs without a text layer, use pdf2image with pytesseract for OCR.

Can I extract text from a scanned PDF?

Scanned PDFs contain images rather than text, so standard parsers return nothing. Convert pages to images with pdf2image, then run pytesseract OCR on each image to recover the text content.

How do I merge or split PDF files from the command line?

Use qpdf to merge files with 'qpdf --empty --pages file1.pdf file2.pdf -- merged.pdf' or split page ranges with the --pages flag. The pdftk tool offers similar merge, burst, and rotate operations if installed.

Why does my filled PDF form show incorrect values in some viewers?

Some PDF viewers require the NeedAppearances flag to render form values correctly, which fill_fillable_fields.py sets automatically. Checkbox and radio values must also match the exact checked values defined in the PDF's field dictionary.