Agent Skill

PDF Processing
Comprehensive PDF manipulation skill covering reading, extraction, merging, splitting, form filling, encryption, watermarking, and OCR operations
What is PDF Processing?
This skill equips agents with the ability to handle comprehensive PDF document operations using established Python libraries. The skill provides structured guidance for reading PDF content, extracting text and tables, merging multiple documents, splitting files into individual pages, rotating pages, adding watermarks, filling forms programmatically, encrypting or decrypting documents, extracting embedded images, and performing OCR on scanned PDFs to enable searchability. The agent learns to use pypdf for basic operations, pdfplumber for advanced table extraction, reportlab for PDF generation, and PyMuPDF for complex manipulations. The skill establishes clear boundaries between simple text extraction and complex form processing, guiding agents to consult specialized form-filling documentation when needed. Trade-offs include library selection based on task complexity—pypdf for lightweight operations versus PyMuPDF for feature-rich requirements—and the balance between processing speed and accuracy when performing OCR. The skill emphasizes proper resource management and error handling when dealing with corrupted or password-protected files.
Key capabilities
Multi-library PDF extraction and manipulation
Supports pypdf for basic operations, pdfplumber for advanced table extraction, and PyMuPDF for complex document manipulations including annotations and embedded content
Form filling with field-level control
Programmatically fills PDF forms by identifying field names, setting values, and flattening forms to prevent further editing, with specialized documentation for AcroForm and XFA forms
OCR integration for scanned documents
Performs optical character recognition on scanned PDFs using Tesseract integration to extract searchable text from image-based documents
Security operations for document protection
Encrypts PDFs with user and owner passwords, sets permissions for printing and copying, and decrypts password-protected documents when credentials are provided
Use cases
Automated invoice data extraction
Extract structured data from PDF invoices by identifying tables, parsing line items, and extracting vendor information for accounting system integration
Batch document merging and organization
Combine multiple PDF files into single documents, reorder pages, split multi-page PDFs by criteria, and add identifying watermarks or headers to processed files
Form processing for government submissions
Fill out complex government or legal forms programmatically by mapping data fields to form inputs, validating required fields, and flattening completed forms for submission
Legacy document digitization
Convert scanned paper documents to searchable PDFs through OCR processing, improving accessibility and enabling full-text search across historical archives
Compatibility
- pypdf
- pdfplumber
- reportlab
- PyMuPDF
