Agent skill

PDF Processing Guide

by shareAI-lab in shareAI-lab/learn-claude-code

Gives the agent command-line and Python recipes for reading, creating, merging and splitting PDF files, plus tips for large and scanned documents.

MITAuto-check passedDocuments & Office

Install PDF Processing Guide

skills CLI
$ npx skills add shareAI-lab/learn-claude-code --skill pdf -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install shareAI-lab/learn-claude-code pdf --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/shareAI-lab/learn-claude-code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/pdf .claude/skills/pdf && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
pdf
GitHub stars
78k
Used in
5 other repos
Token cost
~646 tokens
SKILL.md length
123 words
Files
1
Skills in repo
4
Repo updated
First seen
Licence
MIT

At a glance

Gives the agent command-line and Python recipes for reading, creating, merging and splitting PDF files, plus tips for large and scanned documents.

  • Works in 4 steps: Always check if tools are installed… → Handle encoding issues - PDFs may… → Large PDFs: Process page by page to… → …
  • Extracting text from a PDF report or paper
  • SKILL.md covers Reading PDFs, Creating PDFs, Merging PDFs and Splitting PDFs, plus 2 more sections
  • Calls pip, pdftotext and python3

What it does

The skill covers four jobs. For reading, it prefers pdftotext from poppler-utils for quick extraction and offers PyMuPDF for page-by-page access with metadata. For creating PDFs it suggests pandoc from Markdown, ReportLab for building a file in code, and wkhtmltopdf for HTML. Merging and splitting both use PyMuPDF.

A table lists the libraries and how to install them: PyMuPDF, ReportLab, pdfkit with wkhtmltopdf, and poppler. The best-practice list tells the agent to check that tools are installed before using them, handle character encoding problems, process large PDFs page by page to avoid memory trouble, and fall back to OCR with pytesseract when text extraction from a scanned PDF comes back empty.

When your agent uses it

  • Extracting text from a PDF report or paper
  • Converting a Markdown or HTML file into a PDF
  • Merging several PDFs into one or splitting out page ranges
  • Reading a scanned PDF that needs OCR

Example prompts

  • “Extract the text from invoice-march.pdf and save it to invoice-march.txt.”
  • “Merge cover.pdf, part-one.pdf and part-two.pdf into one book.pdf.”
  • “Turn README.md into a PDF with pandoc.”

Requirements

  • pdftotext from poppler-utils, for text extraction
  • Python with PyMuPDF, and ReportLab for creating files
  • pandoc or wkhtmltopdf for Markdown or HTML conversion

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Always check if tools are installed before using them
  2. Handle encoding issues - PDFs may contain various character encodings
  3. Large PDFs: Process page by page to avoid memory issues
  4. OCR for scanned PDFs: Use pytesseract if text extraction returns empty

What it can do on your machine

Read from SKILL.md and the folder at commit ce8f9f1. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pip
    • pdftotext
    • python3
    • pandoc
    • brew
    • apt

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

PDF Processing Guide loads about 646 tokens when it runs. Until then it costs about 34 tokens; SKILL.md has 123 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~34
When it runs · the whole SKILL.md, loaded when a task matches
~646

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from shareAI-lab/learn-claude-code at commit ce8f9f1, republished under its MIT licence (© shareAI-lab). 123 words, ~646 tokens.

Download SKILL.mdSave it as .claude/skills/pdf/SKILL.md (or your agent's skills folder).
name
pdf
description
Process PDF files - extract text, create PDFs, merge documents. Use when user asks to read PDF, create PDF, or work with PDF files.

PDF Processing Skill

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

Reading PDFs

Option 1: Quick text extraction (preferred)

bash
# 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

python
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)

bash
# 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

python
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()

Option 3: From HTML

bash
# Using wkhtmltopdf
wkhtmltopdf input.html output.pdf

# Or with Python
python3 -c "
import pdfkit
pdfkit.from_file('input.html', 'output.pdf')
"

Merging PDFs

python
import fitz

result = fitz.open()
for pdf_path in ["file1.pdf", "file2.pdf", "file3.pdf"]:
    doc = fitz.open(pdf_path)
    result.insert_pdf(doc)
result.save("merged.pdf")

Splitting PDFs

python
import fitz

doc = fitz.open("input.pdf")
for i in range(len(doc)):
    single = fitz.open()
    single.insert_pdf(doc, from_page=i, to_page=i)
    single.save(f"page_{i+1}.pdf")

Key Libraries

TaskLibraryInstall
Read/Write/MergePyMuPDFpip install pymupdf
Create from scratchReportLabpip install reportlab
HTML to PDFpdfkitpip install pdfkit + wkhtmltopdf
Text extractionpdftotextbrew install poppler / apt install poppler-utils

Best Practices

  1. Always check if tools are installed before using them
  2. Handle encoding issues - PDFs may contain various character encodings
  3. Large PDFs: Process page by page to avoid memory issues
  4. OCR for scanned PDFs: Use pytesseract if text extraction returns empty

© shareAI-lab, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/pdf of shareAI-lab/learn-claude-code.

Open the folder on GitHubat commit ce8f9f1

Used in 6 other repositories

We found 6 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 5 other GitHub owners. This page covers the copy in shareAI-lab/learn-claude-code, which our catalogue first saw on October 7, 2026.

Compare with similar skills

PDF Processing Guide next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

PDF Processing Guide compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
PDF Processing Guide this skillshareAI-lab/learn-claude-code78k5 repos~646Automated safety check: PassMIT
PDF Processinganthropics/skills180k48 repos~2kAutomated safety check: PassProprietary
Docling Document Conversiondocling-project/docling69k—~1.1kAutomated safety check: PassMIT
PDF Processing with PythonHKUDS/DeepTutor41k—~2.7kAutomated safety check: PassApache-2.0
PDF ToolkitTokenRhythm/opensquilla7.1k—~1.9kAutomated safety check: PassApache-2.0
Huashu Markdown Publishing Pipelinealchaincyf/huashu-md-html908—~4.8kAutomated safety check: PassMIT

Similar skills

  • PDF Processing

    anthropics/skills

    Official

    Handles everyday PDF jobs in Python and on the command line: extract text and tables, merge, split, rotate, watermark, fill forms, encrypt and OCR.

    180k GitHub starsUsed in 48 repos~2k tokens
    Documents & OfficeAuto-check passed
  • Docling Document Conversion

    docling-project/docling

    Converts PDFs, Office files, HTML, images and other documents into a unified DoclingDocument with Markdown or JSON output, through the docling CLI, Python SDK or a remote service.

    69k GitHub stars~1.1k tokensUpdated today
    Documents & OfficeAuto-check passed
  • Reads, extracts from, creates, merges, splits, watermarks, encrypts and fills PDF files with pdfplumber, pypdf and reportlab inside a Python sandbox.

    41k GitHub stars~2.7k tokensUpdated today
    Documents & OfficeAuto-check passed
  • PDF Toolkit

    TokenRhythm/opensquilla

    Deterministic PDF operations through bundled scripts: extract text and tables, merge files or page ranges, split by range, fill form fields and build PDFs from data.

    7.1k GitHub stars~1.9k tokensUpdated 3 days ago
    Documents & OfficeAuto-check passed
  • Huashu Markdown Publishing Pipeline

    alchaincyf/huashu-md-html

    Converts files and web pages into clean Markdown, then turns Markdown into polished HTML, Word, PDF and EPUB using four templates.

    908 GitHub stars~4.8k tokensUpdated 1 mo ago
    Documents & OfficeAuto-check passed
  • PDF Toolkit

    XiaomiMiMo/MiMo-Code

    Reads, transforms, composes and fills PDFs with Python scripts for extraction, merging, watermarking, encryption, OCR and form filling.

    14k GitHub stars~1.7k tokensUpdated 5 days ago
    Documents & OfficeAuto-check passed

More from shareAI-lab/learn-claude-code

  • Agent Builder

    shareAI-lab/learn-claude-code

    Design and build AI agents for any domain. An agent skill from shareAI-lab/learn-claude-code.

    78k GitHub starsUsed in 6 repos~1.2k tokens
    Auto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    Auto-check passed
  • MCP Server Builder

    shareAI-lab/learn-claude-code

    Walks through building MCP servers in Python or TypeScript that expose tools, resources and prompts to Claude, with templates, registration and testing.

    78k GitHub starsUsed in 5 repos~1.2k tokens
    Auto-check passed

Works with

Questions about PDF Processing Guide

What does PDF Processing Guide do?

Gives the agent command-line and Python recipes for reading, creating, merging and splitting PDF files, plus tips for large and scanned documents. The skill covers four jobs. For reading, it prefers pdftotext from poppler-utils for quick extraction and offers PyMuPDF for page-by-page access with metadata.

When should I use PDF Processing Guide?

PDF Processing Guide fits situations like: extracting text from a PDF report or paper; converting a Markdown or HTML file into a PDF; merging several PDFs into one or splitting out page ranges; reading a scanned PDF that needs OCR.

How do I install PDF Processing Guide in Claude Code?

Run `npx skills add shareAI-lab/learn-claude-code --skill pdf -a claude-code`. Or copy the skill folder (skills/pdf in shareAI-lab/learn-claude-code) into .claude/skills/pdf in your project. Claude Code loads it when a task matches its description.

How do I install PDF Processing Guide in Codex?

Run `npx skills add shareAI-lab/learn-claude-code --skill pdf -a codex`. Or copy the skill folder (skills/pdf in shareAI-lab/learn-claude-code) into .agents/skills/pdf in your project. Codex loads it when a task matches its description.

Can I use PDF Processing Guide in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add shareAI-lab/learn-claude-code --skill pdf -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pdf, .gemini/skills/pdf, .github/skills/pdf and .opencode/skills/pdf in your project.

What does PDF Processing Guide need to run?

Going by SKILL.md and its folder, PDF Processing Guide needs the command-line tools its instructions call (pip, pdftotext, python3, pandoc, brew and apt). Our summary lists: pdftotext from poppler-utils, for text extraction; Python with PyMuPDF, and ReportLab for creating files; pandoc or wkhtmltopdf for Markdown or HTML conversion.

Does PDF Processing Guide access the network?

SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is PDF Processing Guide safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does PDF Processing Guide use?

PDF Processing Guide is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does PDF Processing Guide use?

About 646 tokens (SKILL.md is roughly 2.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to PDF Processing Guide?

Skills that share tags, products or a category with PDF Processing Guide: PDF Processing (anthropics/skills, 180k stars), Docling Document Conversion (docling-project/docling, 69k stars), PDF Processing with Python (HKUDS/DeepTutor, 41k stars) and PDF Toolkit (TokenRhythm/opensquilla, 7.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains PDF Processing Guide?

shareAI-lab (a GitHub organization) maintains it in shareAI-lab/learn-claude-code, which has 78,138 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on September 28, 2026.

Source: shareAI-lab/learn-claude-code on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.