Skip to content

Practical PDF skill that reads, creates, merges, and splits documents using pdftotext, PyMuPDF, ReportLab, and pandoc.

CCM score
57 of 100
skills.sh installs
187
GitHub stars
81K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers reading PDFs through text extraction, page-by-page access, and metadata inspection
  • Includes creation paths from Markdown via pandoc, programmatic output with ReportLab, and HTML conversion with wkhtmltopdf
  • Provides merge and split recipes built on PyMuPDF, plus a table of libraries and install commands
  • Guides users to check tool availability first and to process large files page by page to limit memory use

Install

$ npx -y skills add shareai-lab/learn-claude-code --skill pdf -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

PDF Processing Skill

You now have expertise in PDF manipulation. Follow these workflows:

Reading PDFs

Option 1: Quick text extraction (preferred)

# Using pdftotext (poppler-utils)
pdftotext input.pdf -  # Output to stdout
pdftotext input.pdf output.txt  # Output to file

# If pdftotext not available, try:
python3 -c "
import fitz  # PyMuPDF
doc = fitz.open('input.pdf')
for page in doc:
    print(page.get_text())
"

Option 2: Page-by-page with metadata

import fitz  # pip install pymupdf

doc = fitz.open("input.pdf")
print(f"Pages: {len(doc)}")
print(f"Metadata: {doc.metadata}")

for i, page in enumerate(doc):
    text = page.get_text()
    print(f"--- Page {i+1} ---")
    print(text)

Creating PDFs

Option 1: From Markdown (recommended)

# Using pandoc
pandoc input.md -o output.pdf

# With custom styling
pandoc input.md -o output.pdf --pdf-engine=xelatex -V geometry:margin=1in

Option 2: Programmatically

from reportlab.lib.pagesizes import letter
from reportlab.pdfgen import canvas

c = canvas.Canvas("output.pdf", pagesize=letter)
c.drawString(100, 750, "Hello, PDF!")
c.save()

Details

Repository
github.com/shareai-lab/learn-claude-code
Category
Office Files & Slides
First seen
Jun 3, 2026

Questions

What does the pdf skill do for Claude Code?

The pdf skill gives Claude Code workflows for processing PDF files, including extracting text, creating PDFs and merging documents. It is meant for requests that ask the agent to read a PDF, create a PDF or work with PDF files.

How do I install the pdf skill?

Run npx -y skills add shareai-lab/learn-claude-code --skill pdf -y inside your project to install it. Once installed, the pdf skill lets the agent extract text from PDFs, build new PDFs and combine several documents into one.

What tools does the pdf skill need?

The pdf skill relies on Python libraries such as PyMuPDF, ReportLab and pdfkit, plus command-line tools like pdftotext from poppler-utils and pandoc. Its SKILL.md tells the agent to check that these tools are installed before using them.

Where does the pdf skill stand in its category?

The pdf skill is listed in the Office Files and Slides category on Claude Marketplaces. Other skills in that category include slideshow and several lark skills, and the pdf skill focuses on reading, creating, merging and splitting PDF files.

Can the pdf skill handle scanned PDFs?

The pdf skill's SKILL.md suggests using pytesseract for OCR when text extraction from a scanned PDF returns empty. It also advises processing large PDFs page by page to avoid memory issues.

More from shareai-lab/learn-claude-code

All 2