Skip to main content

Overview

The PDF skill provides comprehensive PDF processing capabilities including reading and extracting text/tables, combining or splitting PDFs, rotating pages, adding watermarks, creating new PDFs from scratch, filling forms, encrypting/decrypting, extracting images, and performing OCR on scanned documents.
Use this skill for any task involving PDF files - reading, creating, modifying, or converting. For advanced features and detailed examples, consult the skill’s REFERENCE.md file. For PDF form filling, see FORMS.md.

Quick Start

Python Libraries

pypdf - Basic Operations

pdfplumber - Text and Table Extraction

reportlab - Create PDFs

IMPORTANT: Never use Unicode subscript/superscript characters (₀₁₂₃, ⁰¹²³) in ReportLab PDFs. Built-in fonts don’t include these glyphs, causing them to render as solid black boxes.
Instead, use ReportLab’s XML markup tags in Paragraph objects:
For canvas-drawn text (not Paragraph objects), manually adjust font size and position.

Command-Line Tools

pdftotext (poppler-utils)

qpdf

pdftk (if available)

Common Tasks

Extract Text from Scanned PDFs (OCR)

Requires: pip install pytesseract pdf2image

Add Watermark

Extract Images

Password Protection

Quick Reference Table

Best Practices

Library Selection Guide:
  • pypdf: Basic operations (merge, split, rotate, encrypt)
  • pdfplumber: Text and table extraction with layout preservation
  • reportlab: Creating new PDFs from scratch
  • pytesseract: OCR for scanned documents
Common Pitfalls:
  • Avoid Unicode subscripts/superscripts in ReportLab (use XML tags)
  • Always validate PDF output after creation
  • Test OCR accuracy on sample pages before processing large documents
  • Remember that text extraction quality depends on PDF source (native vs scanned)

Next Steps

  • For advanced pypdfium2 usage, see REFERENCE.md
  • For JavaScript libraries (pdf-lib), see REFERENCE.md
  • For PDF form filling instructions, follow FORMS.md
  • For troubleshooting guides, see REFERENCE.md