anthropics/skills · skills/pdf/SKILL.md
“Anthropic's PDF skill: a solid cookbook for every PDF chore, with a sharp trigger and few checks”
What it does
A reference of Python and CLI recipes for reading, merging, splitting, rotating, watermarking, encrypting, creating and OCRing PDFs. Form filling is handed off to forms.md, and advanced topics to reference.md.
- When the agent uses it
- Whenever the user mentions a .pdf file or asks to read, extract, merge, split, rotate, watermark, create, fill, encrypt or OCR a PDF.
- Who it is for
- Install it if your agent touches PDFs at all. Skip it if you never handle PDFs or already have a house PDF toolchain.
- What it costs
- 239 lines, about 2.2k tokens once the agent loads it, plus 11 files beside it.
Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.
What it tells the agent to do
- If the task is filling a PDF form, read FORMS.md and follow it
- For merge, split, rotate, metadata and watermarks, use pypdf
- For text and table extraction, use pdfplumber, with pandas to export tables to Excel
- To create PDFs, use reportlab, and use <sub>/<super> tags instead of Unicode sub/superscripts
- For shell jobs, use pdftotext, qpdf, pdftk or pdfimages
- For scanned PDFs, convert pages to images and OCR them with pytesseract
- For pypdfium2, pdf-lib or troubleshooting, see REFERENCE.md
Lines worth reading
Straight from the file, with why each one matters.
line 3If the user mentions a .pdf file or asks to produce one, use this skill.
A plain trigger that names the file extension. It is hard to miss and easy for the agent to match.
line 171causing them to render as solid black boxes.
The one rule the model would not know on its own. It names a real ReportLab gotcha and gives a fix.
line 11If you need to fill out a PDF form, read FORMS.md and follow its instructions.
Good progressive loading, but the file on disk is forms.md. The case mismatch can break on case-sensitive filesystems.
line 187manually adjust font the size and position
A small typo in an official Anthropic skill. Someone wrote this by hand.
line 157Paragraph("This is the body of the report. " * 20
Lorem ipsum, Python edition: one sentence multiplied until it fills a page.
Watch out for
- Low
The examples write to fixed names like merged.pdf and decrypted.pdf. Copied as-is, they could silently overwrite existing files.
line 42with open("merged.pdf", "wb") as output:
- Low
The OCR recipe expects the agent to pip-install packages, which changes the user's environment.
line 235# Requires: pip install pytesseract pdf2image
The scorecard
- TriggerSays when to use it9/10
Says what and when, lists the tasks, and keys on ".pdf". Near ideal.
- FocusOne clear job7/10
One domain, but it is "anything PDF", a dozen tasks under one roof.
- LeanLight to load7/10
~315 lines, with forms and advanced topics offloaded. Many snippets restate common library use.
- ConcreteSteps you can follow7/10
Plenty of runnable code. No step for checking the output, and the bundled scripts go unmentioned.
- SafeSafe to run9/10
No network calls, secrets or hijacks. Only a pip install and fixed output filenames.
What it does well
- The description is a model trigger: key use first, concrete task verbs, and an explicit ".pdf" cue.
- It offloads the heavy form-filling workflow and the advanced libraries to separate files, loaded only when needed.
- The Unicode subscript warning is real, earned knowledge that saves broken PDFs.
How it could be better
Match linked file names to the real files
The folder has forms.md and reference.md, but SKILL.md says FORMS.md and REFERENCE.md, which fails on case-sensitive systems.
AddFor advanced features, see [reference.md](reference.md). To fill a PDF form, read [forms.md](forms.md) and follow it.
Add a step to check the output
Nothing tells the agent to confirm the result, so a broken merge or a blank render goes unnoticed.
Add## Check your work After writing a PDF, reopen it with PdfReader and confirm the page count. For created or watermarked PDFs, render page 1 to an image (python scripts/convert_pdf_to_images.py <input.pdf> <output_dir>) and look at it before reporting done.
Never overwrite the user's files
The recipes write to fixed names that may already exist in the working directory.
AddWrite results to a new file next to the input (e.g. <input>-merged.pdf). Never overwrite an existing file without asking, and tell the user the output path.
Fix the typo on line 187
It is small, but it reads as sloppy in a reference that agents copy from.
AddFor canvas-drawn text (not Paragraph objects), manually adjust the font size and position rather than using Unicode subscripts/superscripts.
In the skill’s folder
Listed, not read: the agent opens these only when SKILL.md sends it there.
LICENSE.txtforms.mdreference.mdscripts/check_bounding_boxes.pyscripts/check_fillable_fields.pyscripts/convert_pdf_to_images.pyscripts/create_validation_image.pyscripts/extract_form_field_info.pyscripts/extract_form_structure.pyscripts/fill_fillable_fields.pyscripts/fill_pdf_form_with_annotations.py
Kin reviews against Anthropic’s Extend Claude with skills and agentskills.io’s the Agent Skills standard. It reads SKILL.md only, so a script beside it can still do things the file does not say.