PDF 文件处理
pdf-toolkit
从 PDF 中提取文本和表格,以编程方式填写 PDF 表单字段,并将多个 PDF 文件合并为一个。适用于处理 PDF 文档、表单填写、文档提取、拆分或任何 PDF 操作任务。
- License 许可
- MIT
- 最近更新
- 2026-05-15
- Stars
- ★ 13
- Forks
- 1
01 前言 Front Matter
- name
- pdf-toolkit
- title
- pdf-toolkit
- description
- Extract text and tables from PDFs, fill PDF form fields programmatically, and merge multiple PDF files into one. Use when working with PDF documents, form filling, document extraction, splitting, or any PDF manipulation task.
- allowed-tools
- Read Bash(python3 *) Bash(pip install *)
02 资源文件 9
- 参考文档reference/api_methods.md15.0 KB
- 参考文档reference/api_types.md22.2 KB
- 参考文档reference/patterns_and_examples.md27.1 KB
- 参考文档references/extraction.md4.9 KB
- 参考文档references/forms.md4.9 KB
- 参考文档references/merging.md5.2 KB
- 脚本scripts/extract.py4.8 KB
- 脚本scripts/fill_form.py6.6 KB
- 脚本scripts/merge.py7.2 KB
03 SKILL.md 正文
Process PDF files using the bundled scripts.
Capabilities
- Text extraction: read text content from any PDF page or page range → see extraction guide for multi-column layouts, page ranges, table extraction, and OCR limitations
- Form filling: fill PDF form fields programmatically and flatten the result → see forms guide for listing fields, setting values, checkboxes, radio buttons, and flattening
- Merging and splitting: combine multiple PDFs, reorder pages, add bookmarks, or split into individual pages → see merging guide for all merge and split operations
Quick reference
| Task | Command |
|---|---|
| Extract all text | python3 ${CLAUDE_SKILL_DIR}/scripts/extract.py <input.pdf> |
| Extract page range | python3 ${CLAUDE_SKILL_DIR}/scripts/extract.py <input.pdf> --pages 2-5 |
| Fill form | python3 ${CLAUDE_SKILL_DIR}/scripts/fill_form.py <input.pdf> <output.pdf> field=value ... |
| Merge PDFs | python3 ${CLAUDE_SKILL_DIR}/scripts/merge.py <out.pdf> <in1.pdf> <in2.pdf> ... |
Instructions
- Identify which operation the user needs: extraction, form filling, or merging/splitting.
- Read the relevant reference file for detailed instructions and edge case handling.
- Run the appropriate script from
${CLAUDE_SKILL_DIR}/scripts/. - If a required library (
pypdf,pdfplumber) is not installed, offer to install it withpip install <library>before retrying. - Report the output file path or print the extracted text to the user.
04 同仓库更多 Skills
版本号升级与 Git 标签
tag-version
升级软件包版本并创建带注释的 git 标签。接受语义化版本号(1.2.0)或升级类型(patch、minor、major)。不执行推送——请使用 publish 技能进行推送。作为发布工作流的一部分使用。
项目完整发布流程
release
运行完整的发布工作流:变更日志条目、版本升级、git 标签和 GitHub Release。依次调用 changelog-entry、tag-version 和 publish。在发布项目新版本时使用。
GitHub 版本发布
publish
将当前分支和所有标签推送到 origin,然后使用最新标签及其 CHANGELOG.md 条目创建 GitHub Release。在 tag-version 之后使用以完成发布。
变更日志条目生成
changelog-entry
按照 Keep a Changelog 格式为所有未发布的提交起草变更日志条目。将提交分组为新增(Added)、变更(Changed)、修复(Fixed)、移除(Removed)和安全(Security)。在发布新版本之前或更新 CHANGELOG.md 时使用。
代码自动格式化
auto-format-on-edit
每次编辑后使用 Prettier 和 ESLint 自动格式化代码文件。当 Claude 编辑文件时在后台激活。格式化是静默的——没有提示,除非格式化程序失败,否则没有输出。当您希望在编码会话期间自动执行一致的格式化时使用。
代码质量审计
code-quality-audit
运行全面的代码质量审计,涵盖安全性、性能和可维护性。用于季度审计、发布前审查或接入大型代码库时。