Claude Skills graphic design promotion

The `pdf` Claude Code Skill: Create, Fill, and Manipulate PDFs with AI

PDF is simultaneously everywhere and deeply annoying to work with programmatically. Every developer has a story: the library that generates files fine on Mac but corrupts fonts on Linux, the form-fill script that worked until the PDF was updated, the merge operation that scrambled page order. The Python ecosystem alone has half a dozen PDF libraries – reportlab, fpdf2, pypdf, pdfplumber, weasyprint, cairosvg – and picking the right one for the job requires knowing the differences between them in detail.

The pdf Claude Code skill encodes that knowledge. It tells Claude which library to reach for based on what you’re trying to do, the correct patterns for each operation, and the specific pitfalls that aren’t covered in any README. The result is PDF-handling code that works correctly on the first attempt rather than after an afternoon of debugging.

Updated October 2026: added a quick answer, setup notes, a worked example with code and an FAQ.

Quick answer: the pdf Claude Code skill is one of Anthropic’s built-in skills. Once it is enabled, you just describe the PDF job in plain English (create, fill, merge, split or extract) and Claude picks the right Python library and writes the code. There is nothing to install in your project.


What the pdf Skill Covers

The skill handles the full range of PDF operations across five broad categories:

Creating PDFs from scratch. Using reportlab or fpdf2 to generate documents programmatically – invoices, reports, certificates, labels. The skill covers page setup, font embedding, drawing primitives, and table layouts.

Filling PDF forms. Using pypdf or pdfrw to populate AcroForm fields in existing PDFs – the kind of task that sounds simple until you discover that field types, encodings, and font embedding each have their own failure modes. The skill handles these correctly.

Merging and splitting. Combining multiple PDFs into one, extracting specific pages, rotating pages, adding watermarks and page numbers to existing documents. pypdf is the right tool here; the skill specifies the correct API calls.

Extracting text and data. Using pdfplumber for text extraction and table detection from existing PDFs – including scanned documents that need OCR via pytesseract. The skill covers the pre-processing steps that make OCR reliable.

HTML-to-PDF conversion. Using weasyprint or pdfkit (wkhtmltopdf) to convert HTML/CSS to PDF – the right approach for complex layouts with CSS styling. The skill covers the dependency setup that trips people up on headless servers.


Example Workflow: Invoice Generation

A common real-world task: generating a PDF invoice from order data, with your company logo, itemised line items in a table, totals, and payment terms.

Generate a PDF invoice from order.json.
Include:
- Company logo in the top right (assets/logo.png)
- Invoice number, date, and due date in the header
- Itemised table with description, quantity, unit price, and line total
- Subtotal, VAT at 20%, and total at the bottom
- Payment terms paragraph at the foot

Save to output/invoice-{order_id}.pdf

With the pdf skill active, Claude knows to use reportlab for this (not fpdf2, which handles tables less cleanly), the correct approach for embedding the PNG logo without quality loss, and how to calculate column widths so the table renders correctly at A4 dimensions. The resulting script generates a professional invoice PDF that looks right without further adjustment.


Example Workflow: Extracting Data from PDFs

The other common scenario – going the other direction, extracting structured data from PDFs you’ve received:

Extract all invoice line items from the PDFs in /invoices.
Each PDF has a table with columns: Date, Description, Amount.
Output the combined data as a CSV at output/extracted.csv.
Some PDFs may be scanned - use OCR for those.

The skill tells Claude to use pdfplumber for text-based PDFs and pytesseract for scanned ones, how to detect which is which, and the correct pre-processing steps (deskewing, contrast enhancement) that make OCR reliable on real-world scanned documents rather than clean test inputs.


Why Not Just Use pypdf for Everything?

This is the question the skill is specifically designed to answer. pypdf is excellent for merging, splitting, rotating, and basic text extraction. It’s the wrong choice for generating PDFs from scratch (use reportlab or fpdf2), for reliable table extraction from complex layouts (use pdfplumber), and for HTML-sourced documents (use weasyprint). Using pypdf to create a PDF from scratch leads to limited layout control and missing font embedding. The skill routes each task to the right library automatically.


How to Enable the pdf Skill

According to the Claude Code documentation, the pdf and xlsx skills are Anthropic’s built-in skills. They reach Claude Code through your claude.ai account and sync to ~/.claude/skills/synced/ when you sign in with that account, and you can switch them on or off in your claude.ai skills settings. See Extend Claude with skills for where personal and project skills live.

Worked Example: Merging PDFs

A smaller, everyday job. The prompt:

Merge every PDF in ./scans into one file called combined.pdf,
in filename order, and keep the original files untouched.

For a merge the skill steers Claude towards pypdf, as described above. The kind of script it should produce looks like this:

from pathlib import Path
from pypdf import PdfWriter

writer = PdfWriter()
for pdf in sorted(Path("scans").glob("*.pdf")):
    writer.append(str(pdf))

with open("combined.pdf", "wb") as out:
    writer.write(out)

This is an illustrative sketch of the approach rather than captured output; Claude’s exact script will vary with your files. Check the result by opening combined.pdf and confirming the page order before you rely on it.

Frequently Asked Questions

Do I need to install the pdf skill myself?

Not if it is enabled in your claude.ai skills settings. It syncs to your Claude Code install when you are signed in with that account.

Which library does the pdf skill use?

It depends on the task: reportlab or fpdf2 to create PDFs, pypdf to merge, split and fill forms, pdfplumber to extract text and tables, pytesseract for OCR on scans, and weasyprint or pdfkit for HTML to PDF.

Can it read scanned PDFs?

Yes, by routing them through OCR with pytesseract, as in the extraction example above. Results depend on scan quality.

Where are the other document skills?

Claude has matching skills for spreadsheets, Word documents and slide decks. See the guides to the xlsx skill, the docx skill and the pptx skill. The Claude MCP Hub lists the rest of the series.


Further Reading


PDF handling is one of those areas where the gap between “technically possible” and “actually works correctly” is wider than it looks. The pdf skill closes that gap by giving Claude the specific library knowledge and pattern awareness to produce PDF code that’s correct on the first attempt – not after an afternoon of debugging font encoding and page geometry.