agent skills · featured

PDF (Anthropic, official)

Anthropic's official PDF skill from anthropics/skills — read, merge, split, rotate, watermark, fill forms, OCR, and create PDFs via a fixed Python + CLI stack (pypdf, pdfplumber, reportlab, qpdf, pdftotext, pytesseract). Routes via SKILL.md; deeper guides in forms.md and reference.md.
★ 175.5k by Anthropic updated Sep 10, 2026 other
install via your agent of choice
❯ /plugin install document-skills@anthropic-agent-skills (Claude Code marketplace) — or upload via the Skills API: https://docs.claude.com/en/api/skills-guide

## what it does

tl;dr: one of the four document skills Anthropic ships under anthropics/skills (with docx, pptx, xlsx) — SKILL.md stays routing-only and the heavy lifting lives in forms.md (form filling) and reference.md (advanced features). Stack is fixed: pypdf + pdfplumber + reportlab + qpdf + pdftotext, with pytesseract + pdf2image for OCR.

What it actually does

Per the frontmatter, the skill activates for any .pdf mention: read, extract text/tables, merge, split, rotate, watermark, create, fill forms, encrypt/decrypt, extract images, OCR scanned PDFs. The skill is a thin routing layer — it tells Claude which of the pinned libraries to reach for; it does not run on its own.

Tool routing

TaskTool
merge / split / rotate / metadatapypdf (PdfWriter, PdfReader)
extract text with layoutpdfplumber
extract tablespdfplumber → pandas.DataFrame
create new PDFsreportlab (canvas or Platypus)
command-line merge / split / rotateqpdf
OCR scanned PDFspytesseract + pdf2image
fill PDF formspdf-lib or pypdf (see forms.md)
extract imagespdfimages (poppler-utils)
command-line text extractpdftotext -layout

Quick start (read a pdf)

from pypdf import PdfReader

reader = PdfReader("document.pdf")
print(f"Pages: {len(reader.pages)}")

text = ""
for page in reader.pages:
    text += page.extract_text()

Forms path (forms.md)

The deep guide sits at forms.md (lowercase on disk, even though SKILL.md references it as FORMS.md — that’s a misnomer in the prose). The guide splits into two paths: fillable fields vs. non-fillable annotations. Eight helper scripts under skills/pdf/scripts/:

  • check_fillable_fields.py — does the PDF even have fillable fields?
  • extract_form_field_info.py — dump field IDs, page, rect, type
  • extract_form_structure.py — extract labels/lines/checkboxes for non-fillable forms (Approach A)
  • convert_pdf_to_images.py — page-by-page rasterization
  • fill_fillable_fields.py — write the answers into a fillable PDF
  • fill_pdf_form_with_annotations.py — overlay text/boxes on non-fillable forms (structure coords preferred, visual fallback)
  • check_bounding_boxes.py — pre-flight validator for fields.json
  • create_validation_image.py — render the overlays as PNG to eyeball coordinate accuracy

The forms.md guide picks Approach A (structure coordinates) over Approach B (visual estimation with ImageMagick zoom crops) by default — fall back to B only when extract_form_structure.py returns empty labels. Hybrid mode (A for some fields, B for missed elements) is the common case for scanned PDFs with odd graphics.

Reference path (reference.md)

reference.md collects what the routing SKILL.md deliberately omits:

  • pypdfium2 (Python) — fast render + image extraction; the PyMuPDF alternative Anthropic recommends for Chromium-style rendering
  • pdf-lib (JavaScript) — load, create, merge/split PDFs in Node; what Anthropic picks when the skill is called from JS not Python
  • pdfjs-dist (JavaScript) — Mozilla’s PDF.js for browser-side rendering and text-with-coordinates
  • poppler-utils advanced — pdftotext -bbox-layout for text with bounding boxes, pdftoppm for high-res page rasters, pdfimages -j -p for embedded images with metadata
  • qpdf advanced — split-pages, page-range extraction, encryption with permissions, linearization, repair (--check/--fix-qdf)
  • pdfplumber advanced — text with per-character coords, bbox-bounded extraction, custom table-detection settings
  • reportlab advanced — Platypus Table + TableStyle, professional reports
  • batch processing with logging, error isolation, chunked streaming for large PDFs
  • license summary at the end (pypdf BSD, pdfplumber MIT, pypdfium2 Apache/BSD, reportlab BSD, poppler-utils GPL-2, qpdf Apache, pdf-lib MIT, pdfjs-dist Apache)

Gotchas

  • Unicode subscripts/superscripts render as black boxes in reportlab. The built-in fonts don’t include those glyphs. Use <sub> / <super> XML tags in Paragraph objects, not ₀₁₂ / ⁰¹². The SKILL.md repeats this — it’s the most common silent bug.
  • forms.md is its own doc. Read it before touching fillable fields. The scripts live in skills/pdf/scripts/ and expect to be run from that directory; pass the PDF as a relative path.
  • SKILL.md calls them FORMS.md / REFERENCE.md (uppercase) — actual filenames on disk are lowercase. Older tutorials quoting the prose verbatim will misdirect you.
  • License is Proprietary. LICENSE.txt restricts redistribution, derivative works, and extraction outside Anthropic’s services. You use the skill; you don’t fork it.
  • OCR is heavy. pytesseract + pdf2image need both Python packages and the tesseract system binary. Don’t reach for it unless the PDF is scanned; pdfplumber handles born-digital text faster.
  • Validate bounding boxes before filling. check_bounding_boxes.py catches intersecting entries (which produce overlapping text on the rendered PDF) and entries too small for the chosen font size. Run it every time, not just when something looks wrong.
  • Plugins ship from a marketplace, not a clone. /plugin marketplace add anthropics/skills then Browse and install plugins → anthropic-agent-skills → document-skills. Direct git clone lands you outside the Anthropic plugin contract.

Install

# Claude Code (marketplace)
/plugin install document-skills@anthropic-agent-skills

# Or register the whole repo as a marketplace
/plugin marketplace add anthropics/skills

On Claude.ai, the document skills are pre-built for paid plans. On the API, attach via the container.skills parameter:

{
  "model": "claude-opus-5",
  "max_tokens": 4096,
  "container": {
    "skills": [
      { "type": "anthropic", "skill_id": "pdf", "version": "latest" }
    ]
  },
  "messages": [
    { "role": "user", "content": "Extract the tables from /mnt/invoice.pdf" }
  ],
  "tools": [
    { "type": "code_execution_20250825", "name": "code_execution" }
  ]
}

Skills require code_execution_20250825; pinned to the Claude API ID claude-opus-5 in the example. Use the Files API to pull the result back when Claude writes a new PDF.

## compatibility

claude-code ✓
cursor ?
cline ?
aider —

## embed this badge

cache ✓ in cache.directory
![cached](https://cache.directory/badge/anthropic-pdf.svg)