PDF Content Extractor & Annotator

PDF Content Extractor & Annotator is a skill for Claude Code, Codex from davidtoby/agent-skills. It costs 44 tokens per session (1,429 once invoked), scanned A, original, MIT.

A tool for extracting and analyzing PDF content, including text, tables, metadata, and embedded images. It can also combine PDFs, add annotations, remove some watermarks, and use OCR to read scanned pages.

In plain words
What is it for?
Use it to export text as Markdown or plain text, tables as CSV, Excel, or JSON, and metadata as JSON. It also supports creating combined or annotated PDFs and image inventories.
Why use it?
It turns hard-to-reuse PDF content into structured files and reports. OCR helps when a PDF does not contain selectable text.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to export text as Markdown or plain text, tables as CSV, Excel, or JSON, and metadata as JSON. It also supports creating combined or annotated PDFs and image inventories.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/davidtoby/agent-skills/skill-pdf-content-extractor
Install

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.

Any agent
npx skills add davidtoby/agent-skills --skill skill-pdf-content-extractor
Clone the repo
git clone --depth 1 https://github.com/davidtoby/agent-skills

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for PDF Content Extractor & Annotator

README.md
[![agentmods](https://agentmods.dev/badge/skills/davidtoby/agent-skills/skill-pdf-content-extractor.svg)](https://agentmods.dev/skills/davidtoby/agent-skills/skill-pdf-content-extractor)
Your own site
<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>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,429 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 7d ago against content hash 3b19c0e349b0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

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.

The scan reads SKILL.md. This mod also ships 13 executable files (example.py, main.py, scripts/annotate_pdf.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/.archive/umbrella-curation-2026-04-29/openclaw-imports/skill-pdf-content-extractor/SKILL.md · 121 lines

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 处理能力:

  1. 文本提取:提取所有文本内容,保留格式和结构,支持章节识别与图片在 Markdown 报告中的引用
  2. 表格提取:识别并提取表格数据为结构化格式(CSV/Excel/JSON)
  3. 元数据提取:获取作者、创建日期、标题等元信息
  4. PDF 合并:将多个 PDF 文件合并为一个
  5. 智能注释:在 PDF 上添加高亮、批注、标记
  6. 图片提取:提取 PDF 中嵌入图片,输出到目录并生成清单 JSON
  7. 去水印处理:基于规则与启发式清理文本/注释类型水印
  8. OCR 兜底:文本密度不足时可启用 Tesseract OCR 进行识别

使用流程

基础提取

  1. 用户上传 PDF 文件
  2. 系统自动检测内容类型(文本密集型/表格密集型)
  3. 可选启用图片提取与 OCR 兜底
  4. 调用相应的提取脚本并生成结构化报告(Markdown/JSON),可在报告中嵌入图片引用

合并与注释

  1. 用户指定要合并的 PDF 文件
  2. 系统按顺序合并并可选添加书签/页码/目录页
  3. 根据用户需求添加注释(页码、标题、高亮关键词等)
  4. 输出带注释的新 PDF

图片提取流程

  1. 选择处理页码范围(默认全页)
  2. 提取嵌入图片到 output/<文件名>/images
  3. 生成图片清单 output/<文件名>/<文件名>_images.json
  4. 在综合报告或 Markdown 文本中按清单引用图片

去水印流程

  1. 选择模式:pattern(按文本规则)、heuristic(启发式统计)、both(联合)
  2. 加载配置 resources/watermark_patterns.json(可选)
  3. 执行分析并输出统计;如非 --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(联合使用)
  • 注释清理:可选移除 StampFreeText 等注释类型

配置说明

  • text_patterns 支持 containsicontainsregex
  • heuristics 包含 min_font_sizerepeat_threshold_percentmin_text_length
  • remove_annotationsannotation_types 控制注释清理范围

图片提取策略

  • 遍历页面并提取嵌入图片
  • 尺寸过滤(min_width / min_height)避免噪声
  • 字节级 SHA256 去重(跨页同图只保留一次)
  • 可选写出清单并在 Markdown 报告中引用

Read the full file on GitHub · 121 lines

Changes

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.

  1. 7d ago First seen · 121 lines · 44 tokens per session scan A 3b19c0e349b0

Subscribe to this mod's changes

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.

Related

Other skills, from other repositories

pdf-handling

PDF creation, text extraction, merging, splitting, and form-filling.

furkangonel/cowrangler · 19 tokens

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…

aden-hive/hive · 98 tokens

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.

agent0ai/agent-zero · 56 tokens

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…

ericrisco/rsc-harness · 84 tokens

add-pdf-reader

Add PDF reading to ClaudeClaw agents. Extracts text from PDFs via pdftotext CLI. Handles WhatsApp attachments, URLs, and local files.

sbusso/claudeclaw · 37 tokens

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…

personamanagmentlayer/pcl · 102 tokens