Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add davidtoby/agent-skills --skill skill-pdf-content-extractorgit clone --depth 1 https://github.com/davidtoby/agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/davidtoby/agent-skills/skill-pdf-content-extractor)<a href="https://agentmods.dev/skills/davidtoby/agent-skills/skill-pdf-content-extractor"><img src="https://agentmods.dev/badge/skills/davidtoby/agent-skills/skill-pdf-content-extractor.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00044 | $0.01429 |
| Opus 5 | $0.00022 | $0.00714 |
| Sonnet 5 | $0.00009 | $0.00286 |
| Haiku 4.5 | $0.00004 | $0.00143 |
Grade A, and why
PDF Content Extractor & Annotator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PDF Content Extractor & Annotator
功能概述
此技能提供完整的 PDF 处理能力:
- 文本提取:提取所有文本内容,保留格式和结构,支持章节识别与图片在 Markdown 报告中的引用
- 表格提取:识别并提取表格数据为结构化格式(CSV/Excel/JSON)
- 元数据提取:获取作者、创建日期、标题等元信息
- PDF 合并:将多个 PDF 文件合并为一个
- 智能注释:在 PDF 上添加高亮、批注、标记
- 图片提取:提取 PDF 中嵌入图片,输出到目录并生成清单 JSON
- 去水印处理:基于规则与启发式清理文本/注释类型水印
- OCR 兜底:文本密度不足时可启用 Tesseract OCR 进行识别
使用流程
基础提取
- 用户上传 PDF 文件
- 系统自动检测内容类型(文本密集型/表格密集型)
- 可选启用图片提取与 OCR 兜底
- 调用相应的提取脚本并生成结构化报告(Markdown/JSON),可在报告中嵌入图片引用
合并与注释
- 用户指定要合并的 PDF 文件
- 系统按顺序合并并可选添加书签/页码/目录页
- 根据用户需求添加注释(页码、标题、高亮关键词等)
- 输出带注释的新 PDF
图片提取流程
- 选择处理页码范围(默认全页)
- 提取嵌入图片到
output/<文件名>/images - 生成图片清单
output/<文件名>/<文件名>_images.json - 在综合报告或 Markdown 文本中按清单引用图片
去水印流程
- 选择模式:
pattern(按文本规则)、heuristic(启发式统计)、both(联合) - 加载配置
resources/watermark_patterns.json(可选) - 执行分析并输出统计;如非
--dry-run,生成去水印后的 PDF
输出格式
- 文本:Markdown 或纯文本
- 表格:CSV、Excel 或 JSON
- 元数据:JSON 格式
- 合并 PDF:带书签和页码的新 PDF
- 综合报告:包含所有提取内容的 HTML/Markdown 报告
- 图片:输出到
output/<文件名>/images,并生成output/<文件名>/<文件名>_images.json清单
技术细节
文本提取策略
- 使用 pdfplumber 进行精确文本定位
- 保留段落结构和标题层级
- 处理多列布局和复杂排版
- 当文本密度低于阈值时,可启用 OCR(
pytesseract)兜底,ocr_lang指定语言,tesseract_cmd指定可执行路径
表格检测
- 基于边界线的表格检测
- 无边界表格的智能识别
- 跨页表格合并处理
注释类型
- 高亮(Highlight)
- 下划线(Underline)
- 文本批注(Comment)
- 标记(Stamp)
- 链接(Link)
去水印策略(目前效果不是很理想)
- 基于 PyMuPDF(
fitz)的 redaction/编辑引擎 - 文本模式:按
resources/watermark_patterns.json中的text_patterns命中后遮盖 - 启发式模式:统计大字号短语在多页出现的比例,超过阈值则视为水印并遮盖
- 模式说明:
pattern(规则匹配)、heuristic(启发式统计)、both(联合使用) - 注释清理:可选移除
Stamp、FreeText等注释类型
配置说明
text_patterns支持contains、icontains、regexheuristics包含min_font_size、repeat_threshold_percent、min_text_lengthremove_annotations与annotation_types控制注释清理范围
图片提取策略
- 遍历页面并提取嵌入图片
- 尺寸过滤(
min_width/min_height)避免噪声 - 字节级 SHA256 去重(跨页同图只保留一次)
- 可选写出清单并在 Markdown 报告中引用
What ships with it
25 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- .gitignore 279 B
- example.py 5.0 KB runs code
- LICENSE 1.0 KB
- main.py 21 KB runs code
- pdfs/demo.pdf 5483 KB
- pdfs/simple.pdf 195 KB
- README.md 10 KB
- requirements.txt 130 B
- resources/annotation_styles.json 5.6 KB
- resources/image_extraction_config.json 85 B
- resources/table_detection_config.json 2.8 KB
- resources/watermark_patterns.json 1.1 KB
- scripts/annotate_pdf.py 18 KB runs code
- scripts/compare_pdf_renders.py 1.3 KB runs code
- scripts/dump_pdf_text.py 918 B runs code
- scripts/extract_images.py 3.6 KB runs code
- scripts/extract_metadata.py 16 KB runs code
- scripts/extract_tables.py 15 KB runs code
- scripts/extract_text.py 14 KB runs code
- scripts/list_annots.py 730 B runs code
- scripts/merge_pdfs.py 13 KB runs code
- scripts/remove_watermark.py 23 KB runs code
- templates/annotation_template.json 1.1 KB
- templates/extraction_report.md 3.3 KB
- test.py 7.1 KB runs code
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago First seen · 121 lines · 44 tokens per session scan A 3b19c0e349b0
PDF Content Extractor & Annotator is a skill published in the GitHub repository davidtoby/agent-skills (10 stars, last pushed 1mo ago), licensed MIT. It adds 44 tokens to every session and 1,429 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
pdf-handling
PDF creation, text extraction, merging, splitting, and form-filling.
hive.pdf
Read, write, merge, split, rotate, watermark, encrypt, and OCR PDF files using Python (pypdf, pdfplumber, reportlab, pypdfium2) and command-line tools (poppler-utils, qpdf). Use when the user asks to extract text/tables/images from a PDF, create or modify a PDF, combine or split PDFs, OCR a scanned PDF…
document-query
Use when reading, extracting, summarizing, comparing, or answering questions over local or remote documents, code files, PDFs, Office files, HTML/text files, large text-heavy files, and fallback OCR for document images or scans when vision tools are unavailable or insufficient.
document-processing
Use when the deliverable is a document's bytes or its literal content — text/tables out of PDFs, AcroForm fill and flatten, page merge/split, PDF/DOCX from templates, OCR of image-only scans. NOT schema-typed fields pulled from text (that is structured-extraction), NOT signature routing (e-signature) or spreadsheet…
add-pdf-reader
Add PDF reading to ClaudeClaw agents. Extracts text from PDFs via pdftotext CLI. Handles WhatsApp attachments, URLs, and local files.
document-processing-expert
Read, generate and modify office documents and PDFs from code: PDF extraction and forms, Word documents, Excel workbooks and PowerPoint decks. Use when the user mentions PDF, DOCX, XLSX, PPTX, Word, Excel, PowerPoint or spreadsheets, wants data extracted from documents, needs a report or invoice generated as a file…