跳到正文
cccskills
免费在 GitHub 公开中文介绍

pdf

用于创建PDF、提取文字和表格、合并或拆分页面,以及创建和填写表单;还提供扫描文档文字识别和现有PDF文字编辑的操作说明。

原文查看原文说明

PDF files: create, read, merge, fill, OCR, edit text.

AI 评分100分/ 100查看安装方法

适用场景

  • 将报告和发票制作成PDF
  • 复用PDF中的文字和表格
  • 合并文档或提取所需页面
  • 创建和填写PDF表单
  • 识别扫描文字或编辑现有文字

中文介绍

功能

pdf涵盖PDF创建、内容提取和页面处理。可生成含标题、表格和图片的文档,将现有PDF中的文字或表格导出为JSON或CSV,也支持合并、拆分、旋转页面,添加水印、文字或图片,以及创建和填写表单。此外,还附有从扫描图像识别文字的OCR流程,以及用自然语言编辑现有PDF文字的步骤。

适用场景

适合将报告或发票制成PDF、复用收到的资料中的表格,或合并多份文档。针对表单,提供布局检查及填写后核验字段值的步骤。

使用示例

  • “把这份资料中的表格提取为CSV。”
  • “合并这两个PDF,再把需要的页面另存为单独文件。”
  • “创建带输入框和复选框的PDF表单。”

注意事项

需要Python 3.10或更高版本,以及pypdf、reportlab和pdfplumber。导出图像需要额外工具。受字体影响,日文等语言的表单值可能无法显示;提取表格和将表单字段固化后仍须检查。不支持PDF/A的创建和验证。

本介绍由 AI(OpenAI Codex)根据公开的 SKILL.md 撰写。准确的规格请查看下方原文。

客观评估

AI 仅根据 SKILL.md 的内容,从 4 个方面进行了评估。星标数和热度不计入评估。

指令清晰度能否看出何时使用、做什么
A良好列出PDF创建、提取和处理用途,并提供OCR与文字编辑的参考文件位置。
步骤具体性步骤、输入输出和示例是否具体
A良好提供JSON输入规范、各项命令、表单布局检查及填写值复核步骤。
安全性发送数据、删除文件、执行命令等是否有说明
A良好命令指定输出位置,流程要求预先检查、核验布局并重新读取填写值。
安装难易度所需工具和 API 密钥是否少且有说明
A良好说明Python 3.10以上要求、必需库安装命令及图像导出的额外依赖。

总分按每项 A=25 分、B=15 分、C=5 分相加。 由 AI(OpenAI Codex)于 2026年10月20日 评估。仅供参考,安装前请同时查看原文。

如果您认为评估有误,请申请复核

请写明哪一项有误以及原因。无需登录。我们会对照 SKILL.md 重新评估,并在此处更新结果。

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

包含的文件(21)

  • SKILL.md12.2 KB
  • LICENSE1.0 KB
  • references/forms.md3.9 KB
  • references/nano-pdf-editing.md1.3 KB
  • references/ocr-extraction.md5.5 KB
  • scripts/_raster.py2.6 KB
  • scripts/extract_marker.py3.4 KB
  • scripts/extract_pymupdf.py3.6 KB
  • scripts/pdf_create.py4.5 KB
  • scripts/pdf_fill_form.py3.8 KB
  • scripts/pdf_form_layout.py7.0 KB
  • scripts/pdf_make_form.py5.8 KB
  • scripts/pdf_merge.py1.6 KB
  • scripts/pdf_meta.py4.4 KB
  • scripts/pdf_page_image.py3.5 KB
  • scripts/pdf_read.py5.8 KB
  • scripts/pdf_secure.py2.6 KB
  • scripts/pdf_split.py3.0 KB
  • scripts/pdf_stamp.py5.6 KB
  • scripts/pdf_watermark.py1.8 KB
  • tests/test_pdf_skill.py17.0 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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: python -m pip install pypdf reportlab pdfplumber
  • Optional, for page rasterization (pdf_page_image.py, overlay rendering): python -m pip install pypdfium2, or poppler's pdftoppm on PATH. Scripts fall back pypdfium2 → pdftoppm and report {"rendered": false, "missing": [...]} (exit 0) when neither exists.
  • Each helper script checks imports lazily and prints an install hint if a dependency is missing.

How to Run

All helpers live in scripts/ and are argparse CLIs — run them with the terminal tool; every one supports --help. They read/write JSON strictly as UTF-8, print JSON results to stdout, and exit non-zero on failure.

python scripts/pdf_create.py spec.json -o out.pdf         # build PDF from JSON spec
python scripts/pdf_make_form.py formspec.json -o form.pdf # build fillable AcroForm from JSON spec
python scripts/pdf_form_layout.py formspec.json           # lint form layout BEFORE building
python scripts/pdf_form_layout.py formspec.json --render-overlay boxes.png [--pdf form.pdf]
python scripts/pdf_read.py doc.pdf --text                 # per-page text (JSON)
python scripts/pdf_read.py doc.pdf --tables --csv-dir t/  # tables to JSON + CSV files
python scripts/pdf_read.py doc.pdf --meta                 # metadata, page sizes, encrypted/scanned flags
python scripts/pdf_read.py form.pdf --fields              # form fields: name, type, value
python scripts/pdf_merge.py a.pdf b.pdf -o merged.pdf [--bookmarks]
python scripts/pdf_split.py doc.pdf --pages 1-3,7 -o part.pdf [--rotate 90]
python scripts/pdf_fill_form.py form.pdf --fields-json values.json -o filled.pdf [--flatten]
python scripts/pdf_secure.py doc.pdf --encrypt -o enc.pdf --user-password your-password
python scripts/pdf_secure.py enc.pdf --decrypt -o dec.pdf --password your-password
python scripts/pdf_watermark.py doc.pdf --stamp mark.pdf -o stamped.pdf [--under]
python scripts/pdf_stamp.py doc.pdf -o out.pdf --text "DRAFT" --x 150 --y 400 \
    --font-size 60 --rotation 45 --opacity 0.3 --color "#cc0000" [--pages 1-3]
python scripts/pdf_stamp.py doc.pdf -o out.pdf --image sig.png --x 400 --y 60 --width 120
python scripts/pdf_page_image.py doc.pdf --pages 1-3 --dpi 150 --out-dir imgs/
python scripts/pdf_meta.py doc.pdf --set-meta --title "T" --author "A" -o out.pdf
python scripts/pdf_meta.py doc.pdf --attach data.csv -o out.pdf
python scripts/pdf_meta.py doc.pdf --list-attachments | --extract-attachments dir/

Quick Reference

TaskToolCommand / API
Create doc (headings, tables, images)reportlab platypuspdf_create.py spec.json -o out.pdf
Build fillable formreportlab acroFormpdf_make_form.py formspec.json -o form.pdf
Lint form layout / overlay imagepure python + PILpdf_form_layout.py formspec.json [--render-overlay o.png]
Per-page textpdfplumberpdf_read.py f.pdf --text
Tables → JSON/CSVpdfplumberpdf_read.py f.pdf --tables
Metadata / sizes / encrypted / scannedpypdf + pdfplumberpdf_read.py f.pdf --meta
Merge (+ outline)pypdfpdf_merge.py a.pdf b.pdf -o m.pdf
Split / extract / rotatepypdfpdf_split.py f.pdf --pages 2-5 --rotate 90
List / fill / flatten formpypdfpdf_read.py --fields, pdf_fill_form.py
Encrypt / decrypt (AES-256)pypdfpdf_secure.py --encrypt/--decrypt
Watermark / stamp PDF pagepypdfpdf_watermark.py f.pdf --stamp w.pdf
Stamp text/image at coordinatesreportlab + pypdfpdf_stamp.py f.pdf --text "Sign here" --x 400 --y 60
Pages → PNG (review / OCR hand-off)pypdfium2 or pdftoppmpdf_page_image.py f.pdf --pages 1-3 --out-dir imgs/
Set/clear metadata, attachmentspypdfpdf_meta.py --set-meta / --attach / --extract-attachments
Compress content streamspypdfpdf_split.py f.pdf --pages 1-N --compress

Procedure

  1. Inspect first. Run pdf_read.py file.pdf --meta. Check encrypted (if true, decrypt first with pdf_secure.py --decrypt) and likely_scanned_pages. If pages are image-only, export them with pdf_page_image.py --pages <scanned> --dpi 300 --out-dir imgs/ and hand the PNGs to the references/ocr-extraction.md skill — do not report empty text as "no content".
  2. Create. Write a JSON spec with write_file (elements: heading, paragraph, table, image, pagebreak; optional title/author metadata; page numbers are added automatically), then run pdf_create.py. Verify visually with vision_analyze on a rendered page image if layout matters.
  3. Extract. --text gives a JSON list of per-page strings; --tables gives row arrays per page and can also emit CSV files. Read results with read_file; never eyeball a binary PDF directly.
  4. Manipulate. pdf_merge.py concatenates and can add one bookmark per source file; pdf_split.py handles page ranges (1-based, e.g. 1-3,5,9-), rotation in 90° steps, and --compress. Watermark by preparing a single-page stamp PDF (e.g. via pdf_create.py) and overlaying it with pdf_watermark.py; for one-liner stamps ("sign here", diagonal DRAFT, corner labels) use pdf_stamp.py with text or an image at explicit coordinates.
  5. Build forms. Write one form-spec JSON (fields with label_box/entry_box in PDF points — see references/forms.md), lint it with pdf_form_layout.py and fix every reported problem, optionally review the --render-overlay PNG with vision_analyze, then build with pdf_make_form.py and confirm with pdf_read.py --fields.
  6. Fill forms. List fields (--fields) to learn exact names and types, write a UTF-8 JSON of {"FieldName": "value"} with write_file (checkboxes accept true/false; radio/choice values must match the field's export options), then pdf_fill_form.py. Re-read with --fields to confirm values landed.
  7. Metadata & attachments. pdf_meta.py --set-meta writes Title/Author/Subject/Keywords (DocInfo); --clear-meta drops them; --attach/--list-attachments/--extract-attachments round-trip embedded files.
  8. Secure. Encrypt with distinct user/owner passwords and AES-256. To remove a password you know, --decrypt writes an unencrypted copy.
  9. Verify (see below) before reporting success.

Pitfalls

  • Scanned PDFs: empty extract_text() plus page images means there is no text layer. Route to references/ocr-extraction.md; do not fabricate text.
  • Flattening limits: pdf_fill_form.py --flatten uses pypdf's flatten support, which converts widget appearances into page content. It is reliable for plain text fields and checkboxes but can drop or misrender exotic widgets (rich text, custom appearance streams, some radio groups). Verify the flattened output visually with vision_analyze; for bulletproof flattening use an external renderer (e.g. Ghostscript or pdftoppm+reassembly) as a fallback.
  • NeedAppearances: after filling, viewers only render values if appearance streams exist. The fill script sets the AcroForm NeedAppearances flag so conforming viewers regenerate them; some minimal viewers ignore it — flatten if display fidelity matters.
  • Non-Latin form values: values are stored correctly (UTF-16), but the field's default font may lack glyphs, so a viewer can show blanks even though the data round-trips. Verify with --fields, not just visually.
  • Compression expectations: --compress only deflates content streams. Typical savings are 0–20%; it does nothing for PDFs dominated by images or already-compressed streams. It is not a substitute for image downsampling (Ghostscript territory).
  • Permission flags don't enforce: owner-password permission bits (no-print, no-copy) are polite requests that viewers may honor; any library (including pypdf) can read and strip them. Only the user password actually gates content via encryption. Never present permission flags as security.
  • Table extraction is heuristic: pdfplumber detects tables from ruling lines/word alignment; borderless or merged-cell tables may need table_settings tuning or manual cleanup.
  • Page indexing: helper CLIs take 1-based pages; pypdf APIs are 0-based. The scripts convert — don't double-convert.
  • Rotated stamp text extraction: pdfplumber's line grouping scrambles rotated glyphs (a 45° "DRAFT" extracts as stray letters); verify rotated stamps with pypdf's extract_text() or a rendered image instead.
  • Radio groups: reportlab needs ≥2 radio() widgets per group, fills need the slashed export value ("/red"), and flatten fidelity is worst for radios — see references/forms.md.
  • Metadata scope: pdf_meta.py writes the classic DocInfo dictionary only; embedded XMP metadata (if any) is left untouched and may show different values in some viewers.
  • PDF/A is out of scope: pypdf/reportlab cannot produce or validate conformant PDF/A. If archival conformance is required, run Ghostscript via the terminal tool (e.g. gs -dPDFA=2 -dPDFACompatibilityPolicy=1 -sColorConversionStrategy=UseDeviceIndependentColor -sDEVICE=pdfwrite -o out.pdf in.pdf with a suitable ICC profile) and validate with veraPDF — both are external installs, and the result still needs validation, not assumption.
  • Rotation must be a multiple of 90; encrypted inputs must be decrypted before any other operation.

Verification

  • After create/merge/split: pdf_read.py out.pdf --meta — confirm page_count, and per-page rotation when you rotated.
  • After extraction: check the JSON is non-empty and spot-check a known string or cell.
  • Form design loop: pdf_form_layout.py spec.json must exit 0; then --render-overlay boxes.png --pdf form.pdf and review the PNG with vision_analyze (red = entry boxes with field names, blue = label boxes) asking about overlaps, misalignment, and labels detached from their fields. Iterate spec → lint → overlay until clean.
  • After building a form: pdf_read.py form.pdf --fields lists every spec field with the right type and options.
  • After form fill: pdf_read.py filled.pdf --fields and compare values (exact match, including non-ASCII).
  • After stamping: re-extract text (pypdf for rotated stamps) or render the page with pdf_page_image.py and inspect with vision_analyze.
  • After metadata/attachment edits: pdf_read.py --meta / pdf_meta.py --list-attachments, and re-extract an attachment to byte-compare.
  • After encrypt: --meta shows "encrypted": true and opening without a password fails; after decrypt, text extraction matches the original.
  • For anything visual (watermarks, flattened forms), render and inspect with vision_analyze.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

1password

免费有简介AI 评分 100分

通过1Password CLI,将保存的密码和API密钥用于命令及配置模板,完成安装、认证、秘密值读取,并通过环境变量向命令传递凭据。

  • 安装并配置1Password CLI
  • 使用已保存的API密钥运行命令
  • 向配置模板填入秘密值
NousResearch/hermes-agent25.5万2026年10月19日 更新

3-statement-model

免费有简介AI 评分 90分

创建用公式联动利润表、资产负债表和现金流量表的 Excel 模型,分阶段填入历史实际数据与预测假设,比较不同情景,并检查三张报表之间的一致性。

  • 向财务模板填入历史实际数据
  • 建立三张财务报表联动的预测
  • 比较基准、乐观和悲观情景
NousResearch/hermes-agent25.5万2026年10月19日 更新

accelerate

免费有简介AI 评分 80分

以少量修改让现有PyTorch训练代码适用于多GPU或多台机器,指导混合精度、节省内存的DeepSpeed与FSDP配置,以及训练启动方法。

  • 将单GPU训练迁移至多GPU
  • 配置混合精度训练
  • 通过DeepSpeed或FSDP节省内存
NousResearch/hermes-agent25.5万2026年10月19日 更新

actual-setup

免费有简介AI 评分 100分

帮助配置Hermes,通过Actual Computer在自己的设备上运行AI模型。支持加密中继与本地连接,涵盖模型选择、响应测试,以及请求报错或空响应的排查。

  • 使用Actual密钥连接Hermes
  • 在本地设备上运行模型
  • 查找、下载并加载本地模型
NousResearch/hermes-agent25.5万2026年10月19日 更新

adversarial-ux-test

免费有简介AI 评分 80分

扮演不擅长技术、容易不满的用户测试应用,发现难懂的操作和导致放弃使用的障碍。将实际可改进的问题与个人抱怨分开,整理截图、修复建议和任务单。

  • 在发布或演示前检查易用性
  • 检查新用户的使用体验
  • 查找注册和付费流程中的障碍
NousResearch/hermes-agent25.5万2026年10月19日 更新

agent-merge-conflict-arbiter

免费有简介AI 评分 100分

从中立立场解决两个智能体分别修改代码产生的Git冲突,对照双方差异和意图,记录每处冲突的取舍理由,并通过构建或测试验证合并结果。

  • 解决两个智能体的分支冲突
  • 整合并行工作树中的修改
  • 核对冲突设计决策的理由
NousResearch/hermes-agent25.5万2026年10月19日 更新

查看 NousResearch 的全部技能

报告此技能的问题