pdf_skill
- Python
0
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill enoch-robinson/agent-skill-collection --skill pdf- SKILL.md2.5 KB
Overview
This skill provides a practical PDF processing toolkit for extracting text and tables, creating and editing PDFs, merging and splitting documents, rotating pages, and handling simple form workflows. It bundles common programmatic patterns and library recommendations to automate PDF generation and analysis tasks. Use it to build reliable pipelines for document ingestion, transformation, and export.
How this skill works
The skill uses lightweight Python libraries for different responsibilities: pypdf (basic read/write, merge, split, rotate), pdfplumber (accurate text and table extraction), reportlab (generate new PDFs), and pytesseract for OCR on scanned pages. It exposes common code patterns to read pages, extract content, assemble new documents, and perform command-line operations when needed.
When to use it
- Automating extraction of text or tables from many PDF files for downstream analysis.
- Merging multiple reports or splitting a large PDF into individual pages.
- Generating PDFs programmatically, such as invoices or reports.
- Rotating mis-scanned pages or normalizing page orientation before OCR.
- Processing scanned documents by combining OCR with table extraction.
Best practices
- Choose the right library per task: pypdf for structure, pdfplumber for tables, reportlab for creation, pytesseract for OCR.
- Preserve original layout when extracting structured data by using pdfplumber's layout-aware extraction.
- Stream pages rather than loading large PDFs entirely into memory for scalability.
- Validate outputs (text integrity, table columns) with small samples before batch runs.
- Use command-line tools (pdftotext, qpdf) for fast, reliable operations in bulk processing pipelines.
Example use cases
- Extract all invoice tables from a folder of PDFs to CSV for accounting reconciliation.
- Merge monthly reports into a single consolidated PDF for distribution.
- Split a multipage scanned contract into separate page files for electronic signatures.
- Create templated PDF receipts using reportlab populated with database values.
- Rotate and OCR scanned forms to extract handwritten or printed fields programmatically.
FAQ
Use pdfplumber for the most reliable table and layout-aware extractions; pypdf can extract text but is less structured for tables.
How do I handle scanned PDFs with only images?
Run OCR (for example pytesseract) on page images after rotating/cropping as needed; combine with pdfplumber to locate table regions before OCR when possible.