| 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)
pdftotext input.pdf -
pdftotext input.pdf output.txt
Creating PDFs
Option 1: From Markdown
pandoc input.md -o output.pdf
Option 2: Programmatically
from reportlab.pdfgen import canvas
c = canvas.Canvas("output.pdf")
c.drawString(100, 750, "Hello, PDF!")
c.save()
Merging PDFs
import fitz
result = fitz.open()
for pdf_path in ["file1.pdf", "file2.pdf"]:
doc = fitz.open(pdf_path)
result.insert_pdf(doc)
result.save("merged.pdf")
Best Practices
- Check tool availability first
- Handle encoding issues
- Large PDFs page-by-page
- OCR for scanned PDFs if needed