Skip to content
HUIAHUB

anthropics/skills/skills/pdf

PDF processing

Handles PDF tasks: reading and extracting text or tables, merging, splitting, rotating, watermarking, creating, filling forms, encrypting or decrypting, extracting images and OCR on scanned files.

Agent skillAgent skills

What PDF processing does

The SKILL.md is a working reference of Python libraries and command-line tools for common PDF jobs. It uses pypdf to merge, split, rotate, watermark and password-protect files and to read metadata, pdfplumber to pull text and tables (one example combines tables with pandas into an Excel file), and reportlab to build new PDFs. On the command line it reaches for pdftotext, qpdf, pdftk and pdfimages, and scanned pages go through pdf2image and pytesseract for OCR. One specific warning: Unicode subscript and superscript characters show up as black boxes in reportlab's built-in fonts, so the agent uses <sub> and <super> tags instead.

Form filling has its own guide, forms.md, with a fixed order of steps. The agent first runs a script to check whether the PDF has fillable fields. If it does, the agent extracts the field details to JSON, renders the pages to images to work out what each field is for, writes the values and fills the form with another script. For flat forms it extracts the page structure or estimates field positions from images, validates the bounding boxes, adds the text as annotations and renders the output to check it.

A separate reference.md covers pypdfium2, JavaScript libraries such as pdf-lib, and troubleshooting.

Install

/plugin install document-skills@anthropic-agent-skills

Read the security check below before you run it. The repository's own instructions win if they differ.

Security check

What the skill's files do, from reading them. A flag that nobody has checked yet says "Not checked", never "No".

Runs scripts
Yes
Uses the network
No
Installs hooks
No
Asks for secrets
No

The folder ships eight Python scripts for form work, among them check_fillable_fields.py, extract_form_structure.py and fill_pdf_form_with_annotations.py. The agent runs them on your PDFs, and they read input files and write JSON, images and new PDFs using local libraries (pypdf, pdfplumber, pdf2image, Pillow). The scan found no network calls, hooks or secret variables. Before installing, read the scripts, run the skill on copies of your documents, and keep sensitive PDFs out of folders the agent can reach unless you intend to process them.

Scan details: Ships 8 script files: scripts/check_bounding_boxes.py, scripts/check_fillable_fields.py, scripts/convert_pdf_to_images.py, scripts/create_validation_image.py, scripts/extract_form_field_info.py, scripts/extract_form_structure.py, …. Checked at commit 8a1541c4a3ff.

Use cases

  • Extract text and tables from PDFs for analysis or spreadsheets.
  • Merge, split, rotate or watermark existing PDF files.
  • Fill in fillable or flat PDF forms from supplied values.
  • Make scanned PDFs searchable with OCR.

Limitations

  • Relies on Python libraries and tools such as pypdf, pdfplumber, reportlab, pytesseract and qpdf being present.
  • pdftk appears only as an option to use if it is available.
  • Proprietary licence: LICENSE.txt bars copying, redistribution and derivative works.

Sources