What it does
This skill helps with common PDF tasks. It is for anyone who needs to read a PDF, make one, or combine several into one file.
When to use it
- ✓When you want the agent to read or summarize the text of a PDF file.
- ✓When you need to combine several PDF documents into one file.
- ✓When you want to create a PDF from a written document or a web page.
Skill link
https://github.com/shareAI-lab/learn-claude-code/blob/main/skills/pdf/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Read this PDF contract and pull out the text of the payment section.”
5 new skills a week. 1 minute to read.
How it works
The agent uses common PDF tools to pull text out of files, and other tools to make new PDFs from Markdown, HTML, or code.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
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()
Option 3: From HTML
# Using wkhtmltopdf
wkhtmltopdf input.html output.pdf
# Or with Python
python3 -c "
import pdfkit
pdfkit.from_file('input.html', 'output.pdf')
"
Merging PDFs
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
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
| Task | Library | Install |
|---|---|---|
| Read/Write/Merge | PyMuPDF | pip install pymupdf |
| Create from scratch | ReportLab | pip install reportlab |
| HTML to PDF | pdfkit | pip install pdfkit + wkhtmltopdf |
| Text extraction | pdftotext | brew install poppler / apt install poppler-utils |
Best Practices
- Always check if tools are installed before using them
- Handle encoding issues - PDFs may contain various character encodings
- Large PDFs: Process page by page to avoid memory issues
- OCR for scanned PDFs: Use
pytesseractif text extraction returns empty
FAQ
Can it merge PDF files?
Yes. The skill includes a way to merge several PDF files into one.
What tools need to be installed?
Some options need tools such as poppler, pandoc, or wkhtmltopdf, depending on the method.
Can it create a PDF from a web page?
Yes. It can convert HTML into a PDF using wkhtmltopdf.
Details
Original description by the author
Process PDF files - extract text, create PDFs, merge documents. Use when user asks to read PDF, create PDF, or work with PDF files.
Popularity
- GitHub stars
- 80k
- Ranking position
- #1718
- License
- MIT
- Updated
- 10/27/2026
Comments
- …
More skills from this repository
agent-builder
80kTeaches your agent how to design and build its own AI helper for a job, from its tools and knowledge to the steps it repeats.
code-review
80kHelps your agent review code for security holes, logic errors, slow queries, and maintainability before you ship it.
mcp-builder
80kTeaches your agent to build an MCP server that gives Claude new tools, data sources, and prompts for connecting to outside services.
Similar skills
feishu-doc
394kHelps your agent read, create, and edit Feishu cloud documents, including text, images, and tables, using the document tool.
feishu-drive
394kLets your agent browse, organize, and comment on files in a Feishu cloud folder that has been shared with the bot.
feishu-perm
394kHelps your agent check and change who can access a Feishu file, choosing the smallest permission that meets your request.