pdf2md

pdf2md is a skill for Claude Code from renky1025/agent-skills. It costs 190 tokens per session (2,101 once invoked), scanned A, original, MIT.

A PDF-to-Markdown converter for extracting text and structure from PDF files. Markdown is plain text with simple symbols for headings, tables, links, and other formatting.

In plain words
What is it for?
It helps convert individual PDFs or folders, extract images, process scanned documents with OCR, preserve formulas as LaTeX, and produce descriptions of charts in its AI-assisted mode.
Why use it?
It saves time when converting complex or scanned PDFs while retaining elements such as tables, formulas, images, columns, and heading levels.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Good fit It helps convert individual PDFs or folders, extract images, process scanned documents with OCR, preserve formulas as LaTeX, and produce descriptions of charts in its AI-assisted mode.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/renky1025/agent-skills/pdf2md
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 renky1025/agent-skills --skill pdf2md
Clone the repo
git clone --depth 1 https://github.com/renky1025/agent-skills

Made for: Claude Code.

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 pdf2md

README.md
[![agentmods](https://agentmods.dev/badge/skills/renky1025/agent-skills/pdf2md/github.svg)](https://agentmods.dev/skills/renky1025/agent-skills/pdf2md)
Your own site
<a href="https://agentmods.dev/skills/renky1025/agent-skills/pdf2md"><img src="https://agentmods.dev/badge/skills/renky1025/agent-skills/pdf2md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pdf2md

Your own site · 80×15
<a href="https://agentmods.dev/skills/renky1025/agent-skills/pdf2md"><img src="https://agentmods.dev/badge/skills/renky1025/agent-skills/pdf2md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 190 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,101 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00190 $0.02101
Opus 5.5 $0.00076 $0.00840
Sonnet 5.5 $0.00038 $0.00420
Haiku 4.5 $0.00019 $0.00210

Measured 1mo ago against content hash 7c7c65205b9d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pdf2md 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 1mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/pdf2md.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.

pdf2md/SKILL.md · 132 lines

How it starts

The opening of the file, as written. The whole thing — 132 lines — stays where its author put it; the contents beside it link to each section on GitHub.

pdf2md: PDF 转 Markdown 铸造器

Purpose

把一个 PDF 文件或一整个 PDF 文件夹转成可直接用于 AI / RAG 工作流的 Markdown:正文、表格、 LaTeX 公式、图片与标题层级一站式还原,并额外产出带边界框坐标的结构化 JSON 与处理摘要。 底层由 scripts/pdf2md.py 驱动 OpenDataLoader PDF。

When to Use

  • 用户要把 PDF 转成 Markdown / 纯文本 / 结构化 JSON。
  • 用户要从 PDF 里提取表格、公式或图片,或需要溯源坐标。
  • 用户要批量转换一个目录下的多个 PDF。
  • 用户要处理扫描版 PDF(需要 OCR)。
  • 触发词:PDF 转 Markdown、pdf 转 md、PDF 提取文字/表格/公式、扫描件 OCR、批量转换 PDF、 pdf2md、convert PDF to markdown、extract PDF tables/formulas。

When NOT to Use

  • 简单数字版 PDF、只需快速读一遍内容 -> 当前模型可直接读取该 PDF 并输出 Markdown, 不必安装 OpenDataLoader 工具链(见 references/upstream.md 的「备选方案」)。
  • 要处理的是 Word / PPT / HTML 等非 PDF 格式 -> 用各自的转换路径,不是本技能。
  • 目标是把 PDF 内容纳入本地互链知识库 -> 优先用 obsidian-kb-builder。
  • 用户只想看 PDF 的某几页摘要、不要结构化产物 -> 直接读取并回答。

Workflow

  1. 前置检查:java -version(需 11+)、python3 --version(需 3.10+)、 pip show opendataloader-pdf。也可直接跑 python3 <skill>/scripts/pdf2md.py --check。 缺依赖时脚本会自动安装;也可显式 --install。
  2. 选模式:按 ## Decision Rules 决定 fast 还是 hybrid,以及是否需要 --ocr / --formula / --charts。
  3. 执行转换:
python3 <skill>/scripts/pdf2md.py <PDF路径|文件夹> [--output=<目录>] [-m fast|hybrid] [--ocr --ocr-lang=ch_sim] [--formula] [--charts] [--no-images]
  1. 核对输出:确认输出目录里有 *.md、*.json、summary.json、images/, 且图片数量与 summary.json 一致。结构与样例见 examples/sample-output.md。
  2. 报告结果:给出实际输出目录与文件清单(取自 CLI 打印与 summary.json,不要臆测路径)。

Decision Rules

模式选择:

  • 简单数字版 PDF、无复杂表格 -> --mode=fast(默认,约 0.05s/页,无额外依赖)。
  • 复杂/无边框表格、多栏布局、公式、图表描述、扫描件 -> --mode=hybrid。
  • 批量目录内 PDF 超过 10 个 -> --mode=hybrid;实测量级与准确率见 references/performance.md。

附加开关:

  • 扫描版 PDF -> --ocr(必须与 hybrid 同用);中文用 --ocr-lang=ch_sim, 另支持 ch_tra / ja / ko,默认 en。
  • 需要 LaTeX 公式 -> --formula(hybrid 模式)。
  • 需要图表 AI 描述 -> --charts(hybrid 模式)。
  • 不需要图片 -> --no-images(默认提取图片)。
  • hybrid 后端端口被占用 -> --port(默认 5002)。

失败分流:

  • 内存不足 -> 降级到 fast(CLI 会自动做,并在日志中提示)。
  • 加密 PDF -> 停止,要求用户先解密;不要尝试绕过。
  • 表格错乱 / 公式异常 / 扫描件识别差 / 图片缺失 -> 读 references/troubleshooting.md。
  • 需要装依赖或核对上游出处 -> 读 references/upstream.md。

Read the full file on GitHub · 132 lines

Files

What ships with it

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

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. 1mo ago Changed · -83 lines · +91 tokens per session 7c7c65205b9d
  2. 1mo ago First seen · 215 lines · 99 tokens per session scan A cdb286fc1e77

Subscribe to this mod's changes

pdf2md is a skill published in the GitHub repository renky1025/agent-skills (11 stars, last pushed 15d ago), licensed MIT. It adds 190 tokens to every session and 2,101 once invoked, about $0.0008 per session on Opus 5.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.