pdf

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

Updated Aug 5, 2026
One-click install
npx skills add https://github.com/amirbiron/claude-skills --skill pdf-amirbiron
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pdf
Source: https://github.com/amirbiron/claude-skills/tree/main/skills/pdf
Command: npx skills add https://github.com/amirbiron/claude-skills --skill pdf-amirbiron

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pypdf, pdfplumber, pdf2image, Pillow, reportlab, pytesseract, 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, each with different strengths. This Skill consolidates PDF operations—reading, writing, merging, splitting, form filling, and OCR—into one guided workflow with ready-to-run scripts, so you don't have to figure out which tool handles which task. ## 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 Manipulation: Merge, split, rotate, encrypt, decrypt, and watermark PDFs using pypdf, qpdf, and pdftk. - PDF Creation: Generate new PDFs with reportlab, including styled tables, multi-page reports, and proper subscript/superscript rendering. - Form Filling: Fill both fillable AcroForm fields and non-fillable forms using coordinate-based text annotations, with validation scripts that catch bounding box errors before writing output. - Use Case: You receive a scanned government form with no fillable fields. The Skill extracts the form structure, guides coordinate estimation with zoomed image crops, validates the bounding boxes, and produces a filled PDF with correctly positioned text. ## Quick Start Use the pdf skill to merge these three PDF files into a single document and extract the text from the first page.

Frequently Asked Questions about pdf

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

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

Use pdfplumber to extract text with layout preservation and detect tables via page.extract_tables(). For basic text extraction, pypdf's page.extract_text() works, while pdftotext from poppler-utils is fastest for plain text.

How do I fill a PDF form that has no fillable fields?

Extract the form structure with pdfplumber to get label and checkbox coordinates, then create a fields.json with entry bounding boxes and fill it using text annotations via pypdf's FreeText. Validate bounding boxes first to avoid overlapping or undersized fields.

What Python library should I use to merge or split PDF files?

Use pypdf's PdfWriter to merge PDFs by adding pages from multiple readers, or write each page to a separate file to split. The qpdf command-line tool also handles merging and page-range splitting efficiently.

Can I extract text from a scanned PDF document?

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

Why do subscript characters render as black boxes in reportlab PDFs?

ReportLab's built-in fonts lack Unicode subscript and superscript glyphs, so those characters render as solid boxes. Use the <sub> and <super> XML markup tags inside Paragraph objects instead.

How do I handle password-protected or corrupted PDF files?

For encrypted PDFs, call reader.decrypt(password) with pypdf or use qpdf --decrypt with the password. For corrupted files, run qpdf --check to diagnose and qpdf's repair options to rebuild the structure.