Agent Skills: PDF Processing

Extract text, fill forms, and merge PDF files. Use when working with PDF documents, forms, or when users mention PDF processing.

UncategorizedID: louloulin/claude-agent-sdk/pdf-processor

Install this agent skill to your local

pnpm dlx add-skill https://github.com/louloulin/claude-agent-sdk/tree/HEAD/crates/claude-agent-sdk/examples/.claude/skills/pdf-processor

Skill Files

Browse the full folder contents for pdf-processor.

Download Skill

Loading file tree…

crates/claude-agent-sdk/examples/.claude/skills/pdf-processor/SKILL.md

Skill Metadata

Name
pdf-processor
Description
Extract text, fill forms, and merge PDF files. Use when working with PDF documents, forms, or when users mention PDF processing.

PDF Processing

Expert PDF document processing specialist. Extract text, fill forms, merge documents, and manipulate PDFs with precision.

Quick Start

Extract text from PDF:

import pdfplumber

with pdfplumber.open("document.pdf") as pdf:
    page = pdf.pages[0]
    text = page.extract_text()
    print(text)

Capabilities

Text Extraction

  • Extract plain text from PDF pages
  • Preserve layout and formatting
  • Handle multi-page documents
  • Extract tables from PDFs

Form Operations

  • Fill PDF forms programmatically
  • Extract form field data
  • Validate form fields
  • Flatten filled forms

Document Manipulation

  • Merge multiple PDFs
  • split PDFs into pages
  • rotate pages
  • add watermarks
  • compress PDFs

OCR Integration

  • Process scanned PDFs
  • Extract text from images
  • Improve OCR accuracy
  • Handle multiple languages

Additional Resources

Form Field Mappings

For detailed form field mappings and instructions, see forms.md.

API Reference

For complete API documentation, see reference.md.

Usage Examples

See examples.md for more usage examples.

Utility Scripts

Validate PDF files:

python scripts/validate.py document.pdf

Extract form data:

python scripts/extract_forms.py document.pdf

Merge PDFs:

python scripts/merge.py output.pdf input1.pdf input2.pdf

Requirements

Ensure required packages are installed:

pip install pypdf pdfplumber pillow reportlab

Troubleshooting

Common Issues

Problem: Script not found Solution: Ensure scripts have execute permissions: chmod +x scripts/*.py

Problem: Package not installed Solution: Run pip install with required packages

Problem: PDF is encrypted Solution: Unlock the PDF first or provide the password

Problem: OCR not working Solution: Install tesseract OCR: apt-get install tesseract-ocr

Best Practices

DO (Recommended)

  1. Validation

    • Always validate PDF files before processing
    • Check for encryption and permissions
    • Verify file integrity
  2. Error Handling

    • Handle corrupted PDFs gracefully
    • Provide meaningful error messages
    • Log processing steps
  3. Performance

    • Process pages in batches for large PDFs
    • Use multiprocessing when possible
    • Cache extracted data

DON'T (Avoid)

  1. Security Issues

    • ❌ Process PDFs from untrusted sources without validation
    • ❌ Execute embedded scripts in PDFs
    • ❌ Ignore encryption warnings
  2. Performance Issues

    • ❌ Load entire PDF into memory unnecessarily
    • ❌ Process pages sequentially when parallel is possible
    • ❌ Ignore memory limits
  3. Quality Issues

    • ❌ Skip OCR for scanned documents
    • ❌ Ignore layout and formatting
    • ❌ Assume all PDFs have the same structure

Version: 2.0.0 Last Updated: 2025-01-10 Maintainer: Doc Team