This handles the full PDF workflow: reading text from existing files, creating new ones from markdown or HTML, and merging or splitting documents. It wraps PyMuPDF for most operations, with fallbacks to pdftotext and pandoc depending on what you have installed. The skill shines when you need to extract content from a PDF for analysis or programmatically generate reports. One thing to note: it assumes you're working with text-based PDFs, so if you're dealing with scanned documents, you'll need to layer in OCR separately. The markdown-to-PDF path via pandoc is surprisingly clean for generating formatted output without touching ReportLab directly.
- skills.sh installs
- 179
- GitHub stars
- 80.2K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add shareai-lab/learn-claude-code --skill pdf --agent claude-codeInstalls into .claude/skills of the current project.
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()
Sponsors
Details
- Repository
- github.com/shareai-lab/learn-claude-code
- Categories
- Git & Pull Requests, Documentation, Office & Documents
- First seen
- Jun 3, 2026
