What it is
Reads, creates, fills and transforms PDFs: text and table extraction, OCR of scans, filling fillable and flat forms, flattening, merging, splitting, rotating, stamping and encryption. For anyone whose task takes a .pdf or must produce one. It is not a layout design tool.
Core workflow
| Stage | Content |
|---|---|
| Trigger | A task takes a .pdf as input or must output one |
| Input | The PDF, target page ranges, a form field and value JSON, coordinate boxes |
| Steps | Classify the task; forms always go through the scripts in forms.md; text via pdfplumber or pdftotext -layout, and pages with no text are scans, so switch to ocr.md; tables via pdfplumber; new PDFs via reportlab; merge, split, rotate, stamp and encrypt via pypdf; look at every touched page before delivery |
| Output | The changed PDF, a field inventory JSON, validation PNGs and each script’s findings |
| Boundary | Needs uv and poppler (pdftoppm), plus Tesseract for OCR; AES needs pypdf[crypto]; without a rendered check the job is not done |
Getting started: Run check_fillable_fields.py first to learn whether the form is fillable or flat, then choose the matching scripts.
Traits
- A complete form path: identify, extract fields, check ids, pages and values, fill, then flatten
- Flat forms are checked for overlapping or too-short boxes and drawn onto a page for visual review
pdf_coords.pyconverts between page-image pixels and PDF points- Delivery requires looking at every page with
convert_pdf_to_images.py --pages
Who it is for and who it is not for
| Good fit | Poor fit |
|---|---|
| Filling government or institutional forms | Keeping editable form fields, which flattening removes |
| Text and table extraction from scans | Scanned OCR without Tesseract |
| Batch merging, splitting, stamping, encrypting | Complex layout design and typesetting |
How it differs
| Need | Use |
|---|---|
| Read, fill or edit a PDF locally | appautomaton’s pdf (this page) |
| Produce a docx draft | appautomaton’s docx |
| Generate a PDF report from a topic | skywork-doc |
| Fold PDF tables into a workbook | skywork-excel |
Source-level risks
| Risk | Source | Impact |
|---|---|---|
| Two coordinate systems | PDF starts at the bottom-left of the page box in points; pdfplumber and page images start at the top-left, and the box need not start at (0,0) | Stamps and filled values land in the wrong spot, hard to notice |
| Rotated pages | /Rotate only changes display; content and form fields keep unrotated coordinates | A plain scale plus y-flip misses, so transfer_rotation_to_content() is required |
| Merging loses structure | add_page() drops bookmarks and links while append() keeps them; matching field names merge into one field | Navigation and form behaviour change after the merge |
| Fonts and encryption | reportlab’s built-in fonts draw Chinese as black boxes; AES needs pypdf[crypto] | New PDFs show black boxes, or opening raises DependencyError |