pdf

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

8|3|Updated Oct 20, 2025
One-click install
npx skills add https://github.com/chongdashu/claude-code-skills-demo --skill pdf-chongdashu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pdf
Source: https://github.com/chongdashu/claude-code-skills-demo/tree/main/.claude/skills/document-skills/pdf
Command: npx skills add https://github.com/chongdashu/claude-code-skills-demo --skill pdf-chongdashu

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, making tasks like extracting tables, merging documents, or filling forms tedious and error-prone. This Skill consolidates proven PDF workflows into one toolkit with ready-to-run scripts and reference guides. ## Core Features & Use Cases - Text and Table Extraction: Pull text and structured tables from PDFs using pdfplumber and pypdf, with OCR support for scanned documents via pytesseract. - PDF Creation and Manipulation: Merge, split, rotate, encrypt, watermark, and generate PDFs with reportlab, qpdf, and pdf-lib. - Automated Form Filling: Detect fillable form fields, extract field metadata to JSON, and fill both fillable and non-fillable forms using validated bounding-box annotations. - Use Case: You receive a stack of non-fillable PDF application forms. The Skill converts pages to images, guides bounding-box validation, and produces completed PDFs with text annotations placed exactly where data belongs. ## Quick Start Ask the assistant to extract all tables from your PDF file and save them to an Excel spreadsheet.

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. If fields exist, extract their metadata with extract_form_field_info.py and fill them via fill_fillable_fields.py; otherwise use bounding-box annotations with fill_pdf_form_with_annotations.py.

Which Python library should I use for PDF text extraction?

pdfplumber is best for text with layout and tables, while pypdf handles basic text, metadata, merging, and splitting. For rendering pages to images, pypdfium2 provides fast PDFium-based rendering.

Can I extract text from a scanned PDF?

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

Why does my filled PDF form not display values in some viewers?

Some viewers fail to render form values without appearance streams. The fill_fillable_fields.py script calls set_need_appearances_writer(True) so viewers regenerate field appearances, though some may show a save-changes prompt.

How do I merge or split PDFs from the command line?

Use qpdf with the --empty --pages syntax to merge files or select page ranges, and --split-pages to divide a document into chunks. pdftk and pypdf offer equivalent merge and split operations.