它能做什么
这项技能让你的 AI 处理各种 PDF 任务,从制作报告到填写表单。适合任何需要处理 PDF 文件、并希望自动完成的人。
适用场景
- ✓你想把报告、发票或多页文档制作为 PDF 的时候。
- ✓你想填写可填写的 PDF 表单,或从 PDF 中提取文字和表格的时候。
- ✓你想合并、拆分、旋转、添加水印或加密 PDF 文件的时候。
技能链接
https://github.com/NousResearch/hermes-agent/blob/main/skills/productivity/pdf/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把这三份 PDF 发票合并为一个文件,并为每一页添加“草稿”水印。”
每周 5 个新技能,1 分钟读完。
工作原理
这项技能使用 pypdf、reportlab 和 pdfplumber 等 Python 工具读取、制作和修改 PDF。对于扫描文件,它使用单独的 OCR 参考资料;对于文字修改,它使用单独的编辑工具。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
PDF Skill
Create PDFs from structured specs, build and fill AcroForm forms (with layout linting and visual overlays), extract text/tables/metadata, merge/split/rotate/watermark/stamp pages, export page images, manage metadata and attachments, and encrypt/decrypt — using pypdf, reportlab, and pdfplumber. Two absorbed capabilities live in references/ (read the matching file before those tasks):
- Scanned/image-only PDFs and OCR (pymupdf fast path, marker-pdf quality path, scripts/extract_pymupdf.py + scripts/extract_marker.py):
references/ocr-extraction.md - Editing text inside an existing PDF via natural-language prompts (nano-pdf CLI):
references/nano-pdf-editing.md
When to Use
- Generate a report, invoice, or multi-page document as PDF.
- Build a fillable AcroForm (text/checkbox/radio/dropdown) from a JSON spec, linting the layout first.
- Pull text, tables (JSON/CSV), metadata, or form-field values out of a PDF.
- Merge, split, rotate, extract page subsets, watermark, stamp text/images at coordinates, bookmark, or compress PDFs.
- Export pages as PNGs for visual review or for OCR hand-off; set/clear document metadata; add/extract file attachments.
- Fill or flatten AcroForm forms; encrypt or decrypt with passwords.
- NOT for scanned/image-only PDFs (use
references/ocr-extraction.md) and NOT for pixel-perfect HTML-to-PDF rendering (use a headless browser).
Prerequisites
Python 3.10+ with
pypdf,reportlab,pdfplumber.Pick the interpreter with
terminal. Usepythonwhen it already imports the libraries (the Hermes Docker image ships them). Otherwise, whenhermesis on PATH, let Hermes build its shared, pinned documents environment under the Hermes home: it survives container restarts, never touches the Hermes install itself, and is safe to run from several agents at once. When it is not (the terminal runs in a Docker sandbox, which has no Hermes), the block builds a venv in the sandbox home with the same pinned versions. Use this exact block in every document skill so they all share one environment:python -c "import pypdf, reportlab, pdfplumber" 2>/dev/null && PY=python || if command -v hermes >/dev/null 2>&1; then PY="$(hermes pm environment documents --extra documents --extra documents-pdf)" else PY="$HOME/.cache/hermes-docs-venv/bin/python" "$PY" -c "import docx, openpyxl, pptx, reportlab, pypdf, pdfplumber, pypdfium2" 2>/dev/null || ( # Safe to run from several agents at once: each caller builds a private venv, # a symlink publishes the first finished one atomically, the others delete theirs; # a published build is replaced and deleted only while it still fails to import. mkdir -p "$HOME/.cache" && cd "$HOME/.cache" && stage="$(mktemp -d hermes-docs-venv.XXXXXX)" || exit 1 old="$(readlink hermes-docs-venv)" # the published build, if any (another agent may have just published it) python3 -m venv "$stage" && "$stage/bin/python" -m pip install -q --disable-pip-version-check python-docx==1.2.0 openpyxl==3.1.5 python-pptx==1.0.2 reportlab==5.1.0 pypdf==6.21.2 pdfplumber==0.11.10 pypdfium2==5.14.0 && "$stage/bin/python" -c "import docx, openpyxl, pptx, reportlab, pypdf, pdfplumber, pypdfium2" && if [ -z "$old" ]; then python3 -c 'import os, sys; os.symlink(*sys.argv[1:])' "$stage" hermes-docs-venv elif [ "$(readlink hermes-docs-venv)" = "$old" ] && ! "$old/bin/python" -c "import docx, openpyxl, pptx, reportlab, pypdf, pdfplumber, pypdfium2" 2>/dev/null; then ln -s "$stage" "$stage.lnk" && python3 -c 'import os, sys; os.replace(*sys.argv[1:])' "$stage.lnk" hermes-docs-venv && case "$old" in hermes-docs-venv.??????) rm -rf "$old" ;; esac fi 2>/dev/null [ "$(readlink hermes-docs-venv)" = "$stage" ] || rm -rf "$stage" "$stage.lnk" ) fi export PY "$PY" scripts/pdf_create.py --helpRun every helper below with
"$PY". In PowerShell (Hermes runs on that host, so it is on PATH):$env:PY = hermes pm environment documents --extra documents --extra documents-pdf. Neverpip installinto the interpreter that runs Hermes or into thehermes pm environmentone; Hermes owns both.Page rasterization (
pdf_page_image.py, overlay rendering) usespypdfium2, which the documents environment already has (if yourpythonlacks it, switchPYto that environment with the command above), or poppler'spdftoppmon PATH.
常见问题
它能处理扫描版 PDF 吗?
不能直接处理。技能说明扫描版 PDF 需要使用其 OCR 参考文件,该文件依赖其他工具。
它能填写表单吗?
能。技能涵盖制作和填写可填写表单,包括文本、复选框、单选框和下拉字段。
它能制作与网页像素级一致的 PDF 吗?
不能。技能说明,对于这种 HTML 转 PDF 的渲染,无界面浏览器更合适。
详情
热度
- GitHub 星标
- 260k
- 排名
- #611
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-merge-conflict-arbiter
260k以中立第三方的身份,解决两个智能体分支之间的 git 合并冲突,为代码仓库生成一个合并结果。
antigravity-cli
260k指导你安装、更新和排查 Antigravity 命令行工具,包括其插件、登录和沙盒。
blackbox
260k让你的智能体把编程任务交给 Blackbox AI 命令行工具,它会运行多个 AI 模型并挑选最佳结果。
dynamic-workflow
260k教你的智能体把大量相似的工作保存为脚本批量运行,使只有经过验证的结果才返回主对话。