document-pdf
40
总安装量
40
周安装量
#5162
全站排名
安装命令
npx skills add https://github.com/vasilyu1983/ai-agents-public --skill document-pdf
Agent 安装分布
claude-code
27
cursor
20
opencode
19
codex
18
antigravity
16
Skill 文档
Document PDF Skill â Quick Reference
This skill enables PDF creation, extraction, manipulation, and analysis. Claude should apply these patterns when users need to generate invoices, reports, extract data from PDFs, merge documents, or work with PDF forms.
Modern Best Practices (Jan 2026):
- PDF is a release artifact, not the editable source of truth.
- Validate export fidelity (fonts, images, links) and accessibility where required.
- Accessibility: if compliance matters, target a tagged/structured PDF workflow (often PDF/UA-aligned) and validate with tooling.
- EU distribution: EAA (June 2025) typically implies EN 301 549 expectations for customer-facing PDFs.
- Treat PDFs as sensitive: scrub metadata, ensure real redaction, and control distribution.
Core Decision Rules (2026)
- First decide: born-digital PDF (selectable text) vs scanned PDF (images). Scanned PDFs usually require OCR; see
references/pdf-extraction-patterns.md. - If the user needs accessibility/compliance, prefer generating from a source format that supports structure (DOCX/HTML + proper export) rather than âpost-fixingâ an untagged PDF.
- For deterministic ops (merge/split/rotate/scrub), prefer
scripts/helpers over re-implementing ad hoc. - Never treat black rectangles or overlays as redaction; use real redaction and verify by copy/paste + search.
Quick Reference
| Task | Tool/Library | Language | When to Use |
|---|---|---|---|
| Create PDF | pdfkit | Node.js | Reports, invoices, certificates |
| Create PDF | ReportLab | Python | Complex layouts, tables |
| Create PDF | FPDF2 | Python | Simple PDFs with Unicode support |
| Create PDF | Borb | Python | Interactive elements, pure Python |
| Edit PDF | pdf-lib | Node.js | Modify existing PDFs, add pages |
| Extract text | pdfplumber | Python | OCR-free text extraction |
| OCR scanned PDF | PyMuPDF + Tesseract | Python | Scanned PDFs (no selectable text) |
| Extract tables | Camelot | Python | Tables with borders (Lattice mode) |
| Extract tables | Camelot/Tabula | Python | Tables without borders (Stream mode) |
| Parse/merge/split/rotate | pypdf | Python | Deterministic PDF manipulation |
| Fill forms | pdf-lib | Node.js | Form automation |
| HTML to PDF | Puppeteer/Playwright | Node.js | High-fidelity web page rendering |
| HTML to PDF | WeasyPrint | Python | CSS3-based, no browser needed |
When to Use This Skill
Claude should invoke this skill when a user requests:
- Generate PDFs from data (invoices, reports, certificates)
- Extract text or tables from existing PDFs
- Merge multiple PDFs into one document
- Split PDFs into separate files
- Fill PDF forms programmatically
- Add watermarks, headers, footers
- Convert HTML/web pages to PDF
Default Workflow
- Create: pick
pdfkit(Node) orReportLab(Python) and start fromassets/invoice-template.mdorassets/report-template.md; for advanced layouts usereferences/pdf-generation-patterns.md. - Extract: use
references/pdf-extraction-patterns.md(text/tables/images/metadata + OCR fallback). - Ship: run
assets/pdf-release-checklist.md(fidelity, links, accessibility baseline, privacy).
Scripts (Deterministic Operations)
Scripts are optional helpers; they assume Python 3 plus the listed dependencies in each file.
- Merge:
python3 scripts/merge_pdfs.py merged.pdf a.pdf b.pdf - Split:
python3 scripts/split_pdf.py in.pdf out_dir --each-page - Rotate:
python3 scripts/rotate_pdf.py in.pdf out.pdf --degrees 90 - Scrub metadata:
python3 scripts/scrub_metadata.py in.pdf out.pdf
PDF Structure Patterns
Invoice Template
INVOICE STRUCTURE
âââ Header (logo, company info, invoice #)
âââ Bill To / Ship To blocks
âââ Line items table
â âââ Description | Qty | Unit Price | Total
â âââ Subtotal, Tax, Total
âââ Payment terms
âââ Footer (contact, thank you)
Report Template
REPORT PDF STRUCTURE
âââ Cover page (title, author, date)
âââ Table of contents
âââ Body sections with page numbers
âââ Charts/images with captions
âââ Appendices
âââ Running header/footer
Decision Tree
PDF Task: [What do you need?]
ââ Create new PDF?
â ââ Simple text/tables â pdfkit (Node) or ReportLab (Python)
â ââ Complex layouts â ReportLab with Platypus
â ââ From HTML â Puppeteer or wkhtmltopdf
â
ââ Extract from PDF?
â ââ Text only â pdfplumber (Python)
â ââ Tables â pdfplumber or camelot (Python)
â ââ Images â PyMuPDF/fitz (Python)
â
ââ Modify existing PDF?
â ââ Add text/images â pdf-lib (Node)
â ââ Merge/split â pypdf or pdf-lib
â ââ Fill forms â pdf-lib
â
ââ Batch processing?
ââ pypdf + pdfplumber pipeline
Do / Avoid (Jan 2026)
Do
- Keep a versioned source document (doc/slide/design file) alongside the PDF.
- Verify links and reading order for long documents.
- Use real redaction and test by copy/paste.
Avoid
- Editing PDFs as the primary workflow when a source doc exists.
- Shipping PDFs with broken links or illegible charts.
- Including customer PII or secrets in PDFs without explicit approval.
What Good Looks Like
- Fidelity: export is reproducible from a versioned source file (doc/slide/design) and looks identical across viewers.
- Accessibility: tags/reading order are correct; links work; scanned docs are OCRed when appropriate.
- Release hygiene: file naming includes version/date; metadata is clean; no âPDF as source of truthâ.
- Security: redaction is verified (copy/paste test) and sensitive data is minimized.
- QA: release checklist completed using
assets/pdf-release-checklist.md.
Optional: AI / Automation
Use only when explicitly requested and policy-compliant.
- Generate a release checklist run; humans verify the final PDF manually.
Navigation
Resources
- references/pdf-generation-patterns.md â Complex layouts, multi-page docs
- references/pdf-extraction-patterns.md â Text, table, image extraction
- data/sources.json â Library documentation links
Templates
- assets/invoice-template.md â Invoice PDF generation
- assets/report-template.md â Multi-page report structure
- assets/pdf-release-checklist.md â Links, accessibility, export fidelity
Related Skills
- ../document-docx/SKILL.md â Word document generation
- ../document-xlsx/SKILL.md â Excel/spreadsheet workflows
- ../document-pptx/SKILL.md â PowerPoint presentations