PDF Processing
Gotchas
- Never use Unicode subscript/superscript characters (₁, ², etc.) in ReportLab PDFs. Built-in fonts don't include these glyphs, rendering them as solid black boxes.
- OCR requires the
tesseractsystem binary, not justpip install pytesseract. On macOS:brew install tesseract. - Watermark PDFs must have transparent backgrounds.
merge_page()composites content — a watermark with a white background will cover the document.
Instructions
Step 1: Identify the Operation
Determine what the user needs: read/extract text, merge, split, rotate, create, fill forms, OCR, watermark, encrypt/decrypt, or extract images. If the task involves filling a PDF form, read references/forms.md and follow its instructions instead of continuing here.
Step 2: Choose the Right Tool
| Task | Best Tool | Command/Code |
|---|---|---|
| Merge PDFs | pypdf | writer.add_page(page) |
| Split PDFs | pypdf | One page per file |
More from nielsmadan/agentic-coding
code-review
Code review workflow. Use when reviewing code changes, PRs, or specific files for quality, bugs, and best practices.
13review-comments
Review and clean up low-quality code comments. Use when you notice "what" comments that should be "why" comments, or want to clean up comment noise before a PR.
12research-online
Research a programming topic online from multiple sources. Use when asking "how do I implement X", comparing libraries (X vs Y), looking up best practices, debugging unfamiliar errors, or needing up-to-date documentation beyond the knowledge cutoff.
12resolve-conflicts
Resolve git conflicts from any operation (merge, rebase, cherry-pick, stash, revert). Use when encountering conflicted files during git operations.
11theme-factory
Apply professional visual themes to artifacts (presentations, documents, reports, HTML pages, landing pages). Use when user asks to "style this", "apply a theme", "make this look better", "beautify", or requests specific aesthetics like minimalist, modern, luxury, etc. Includes 10 preset themes and custom theme generation.
11frontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, artifacts, posters, or applications (websites, landing pages, dashboards, React components, HTML/CSS layouts) or when styling/beautifying any web UI.
11