document-pdf by vasilyu1983/ai-agents-public
npx skills add https://github.com/vasilyu1983/ai-agents-public --skill document-pdf此技能支持 PDF 的创建、提取、操作和分析。当用户需要生成发票、报告、从 PDF 中提取数据、合并文档或处理 PDF 表单时,Claude 应应用这些模式。
现代最佳实践(2026年1月):
references/pdf-extraction-patterns.md。scripts/ 中的辅助工具,而不是重新实现临时方案。| 任务 | 工具/库 | 语言 | 使用场景 |
|---|---|---|---|
| 创建 PDF | pdfkit | Node.js |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 报告、发票、证书 |
| 创建 PDF | ReportLab | Python | 复杂布局、表格 |
| 创建 PDF | FPDF2 | Python | 支持 Unicode 的简单 PDF |
| 创建 PDF | Borb | Python | 交互式元素,纯 Python |
| 编辑 PDF | pdf-lib | Node.js | 修改现有 PDF,添加页面 |
| 提取文本 | pdfplumber | Python | 无需 OCR 的文本提取 |
| 扫描 PDF 的 OCR | PyMuPDF + Tesseract | Python | 扫描 PDF(无可选文本) |
| 提取表格 | Camelot | Python | 带边框的表格(Lattice 模式) |
| 提取表格 | Camelot/Tabula | Python | 不带边框的表格(Stream 模式) |
| 解析/合并/拆分/旋转 | pypdf | Python | 确定性 PDF 操作 |
| 填充表单 | pdf-lib | Node.js | 表单自动化 |
| HTML 转 PDF | Puppeteer/Playwright | Node.js | 高保真网页渲染 |
| HTML 转 PDF | WeasyPrint | Python | 基于 CSS3,无需浏览器 |
当用户请求以下内容时,Claude 应调用此技能:
pdfkit(Node)或 ReportLab(Python),并从 assets/invoice-template.md 或 assets/report-template.md 开始;对于高级布局,请使用 references/pdf-generation-patterns.md。references/pdf-extraction-patterns.md(文本/表格/图像/元数据 + OCR 后备方案)。assets/pdf-release-checklist.md(保真度、链接、可访问性基线、隐私)。脚本是可选的辅助工具;它们假定使用 Python 3 以及每个文件中列出的依赖项。
python3 scripts/merge_pdfs.py merged.pdf a.pdf b.pdfpython3 scripts/split_pdf.py in.pdf out_dir --each-pagepython3 scripts/rotate_pdf.py in.pdf out.pdf --degrees 90python3 scripts/scrub_metadata.py in.pdf out.pdfINVOICE 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 PDF STRUCTURE
├── Cover page (title, author, date)
├── Table of contents
├── Body sections with page numbers
├── Charts/images with captions
├── Appendices
└── Running header/footer
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
assets/pdf-release-checklist.md 完成发布检查清单。仅在明确请求且符合政策时使用。
资源
模板
相关技能
每周安装次数
167
代码仓库
GitHub 星标数
46
首次出现
Jan 23, 2026
安全审计
安装于
opencode141
cursor140
gemini-cli138
codex137
github-copilot134
amp124
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) :
references/pdf-extraction-patterns.md.scripts/ helpers over re-implementing ad hoc.| 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 |
Claude should invoke this skill when a user requests:
pdfkit (Node) or ReportLab (Python) and start from assets/invoice-template.md or assets/report-template.md; for advanced layouts use references/pdf-generation-patterns.md.references/pdf-extraction-patterns.md (text/tables/images/metadata + OCR fallback).assets/pdf-release-checklist.md (fidelity, links, accessibility baseline, privacy).Scripts are optional helpers; they assume Python 3 plus the listed dependencies in each file.
python3 scripts/merge_pdfs.py merged.pdf a.pdf b.pdfpython3 scripts/split_pdf.py in.pdf out_dir --each-pagepython3 scripts/rotate_pdf.py in.pdf out.pdf --degrees 90python3 scripts/scrub_metadata.py in.pdf out.pdfINVOICE 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 PDF STRUCTURE
├── Cover page (title, author, date)
├── Table of contents
├── Body sections with page numbers
├── Charts/images with captions
├── Appendices
└── Running header/footer
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
assets/pdf-release-checklist.md.Use only when explicitly requested and policy-compliant.
Resources
Templates
Related Skills
Weekly Installs
167
Repository
GitHub Stars
46
First Seen
Jan 23, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode141
cursor140
gemini-cli138
codex137
github-copilot134
amp124
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
152,900 周安装
| 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 |