pdf-image-text-extractor

pdf-image-text-extractor is a skill for Claude Code, Codex from redfox-data/redfox-community-dsh. It costs 179 tokens per session (4,253 once invoked), scanned A, original, MIT.

A tool for reading text from images and PDF files, including scanned documents. OCR means recognizing printed or handwritten characters in an image and turning them into editable text.

In plain words
What is it for?
Use it to extract text from PNG, JPG, GIF, WebP, BMP, and PDF files, display the result, or save it as a Markdown file.
Why use it?
It avoids manually typing text from documents and preserves the original paragraphs and structure where possible. It also reports when an image contains no extractable text or when a PDF cannot be processed.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: built for openclaw.

Good fit Use it to extract text from PNG, JPG, GIF, WebP, BMP, and PDF files, display the result, or save it as a Markdown file.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/redfox-data/redfox-community-dsh/pdf-image-text-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 redfox-data/redfox-community-dsh --skill pdf-image-text-extractor
Clone the repo
git clone --depth 1 https://github.com/redfox-data/redfox-community-dsh

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-image-text-extractor

README.md
[![agentmods](https://agentmods.dev/badge/skills/redfox-data/redfox-community-dsh/pdf-image-text-extractor/github.svg)](https://agentmods.dev/skills/redfox-data/redfox-community-dsh/pdf-image-text-extractor)
Your own site
<a href="https://agentmods.dev/skills/redfox-data/redfox-community-dsh/pdf-image-text-extractor"><img src="https://agentmods.dev/badge/skills/redfox-data/redfox-community-dsh/pdf-image-text-extractor/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 pdf-image-text-extractor

Your own site · 80×15
<a href="https://agentmods.dev/skills/redfox-data/redfox-community-dsh/pdf-image-text-extractor"><img src="https://agentmods.dev/badge/skills/redfox-data/redfox-community-dsh/pdf-image-text-extractor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 179 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,253 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.00179 $0.04253
Opus 5.5 $0.00072 $0.01701
Sonnet 5.5 $0.00036 $0.00851
Haiku 4.5 $0.00018 $0.00425

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

Security

Grade A, and why

pdf-image-text-extractor 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 4 executable files (scripts/batch_extractor.py, scripts/changelog.py, scripts/pdf_text_extractor.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/pdf-image-text-extractor/SKILL.md · 314 lines

How it starts

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

PDF和图片文字提取

任务目标

  • 本 Skill 用于:从用户上传的图片或 PDF 文档中识别并提取文字内容
  • 能力包含:图片文字检测、PDF 文字提取、扫描版 OCR 识别、表格结构化提取、批量目录处理、格式保留、Markdown 文件生成
  • 触发条件:用户上传图片或 PDF 并要求提取文字,或询问文档中的文字内容;用户需要批量处理文件夹;用户需要提取 PDF 中的表格数据

🔑 鉴权

本 Skill 完全免费,但需配置红狐 API Key 请求使用权限,Key 本身不扣积分。

前往 红狐hub 注册获取个人 API Key,通过以下任一方式配置:

# 方式一:配置文件(如 OpenClaw 的 ~/.openclaw/openclaw.json)
{ "env": { "REDFOX_API_KEY": "ak_xxxx..." } }

# 方式二:终端环境变量
export REDFOX_API_KEY="ak_xxxx..."

⚠️ 每次执行任何操作前,必须先运行 python3 scripts/record.py。 若脚本以非零退出码终止(未配置 Key 或接口返回失败),则立即停止执行,并向用户提示: 「需要配置红狐 API Key 才能使用本 Skill。请前往 https://redfox.hk/settings/api-keys?source=github 免费注册获取,然后配置环境变量:export REDFOX_API_KEY="ak_xxxx..."」

前置准备

必要依赖

pymupdf>=1.23.0
requests>=2.28.0
pip install pymupdf>=1.23.0 requests>=2.28.0

零额外依赖说明

本 Skill 无需安装任何 OCR 引擎或表格库:

  • 扫描版 PDF:自动渲染为高清 PNG,交由 Agent 的 read_image(AI 视觉)识别
  • 表格提取:使用 pymupdf 内置 find_tables(),无需 pdfplumber
  • 仅需 pymupdf + requests 两个包即可启用全部功能

支持的文件格式

  • 图片格式:PNG、JPG、JPEG、GIF、WebP、BMP、TIFF
  • 文档格式:PDF(文字版 + 扫描版,扫描版自动渲染为图片由 AI 识别)

操作步骤

标准流程

Step 0:鉴权检查(必须首先执行)
python3 scripts/record.py
  • 输出 ✅ 鉴权通过,已获得使用权限 → 继续后续流程
  • 脚本以非零退出码终止 → 立即停止,向用户展示脚本输出的错误提示,告知需前往 红狐hub 免费获取 API Key
Step 0.5:版本更新提示(每次执行)
python3 scripts/changelog.py
  • 若有输出(首次使用或版本升级)→ 将输出内容完整展示给用户,然后继续
  • 若无输出(版本已是最新)→ 直接继续
图片文字提取流程
  1. 接收图片

    • 确认用户已上传图片文件
    • 获取图片的访问 URL
  2. 识别图片内容(第一轮:全局识别)

    • 使用 read_image 工具识别图片内容
    • 在 prompt 中明确要求识别所有文字内容,包括标题、正文、注释、水印等
    • 对数字字符需特别注意视觉形状特征(封闭圆圈数、开口方向、弧线走向),确保 6/8/9/0/3 等易混淆数字准确识别
  3. 判断文字存在性

    • 如果检测到文字:进入步骤 4
    • 如果未检测到文字:告知用户"图片中未包含可提取的文字",任务结束
  4. 提取并整理文字

    • 提取图片中的所有文字内容
    • 保持原有的结构和排版
    • 整理为易读的格式
  5. 数字二次聚焦校验(静默执行,不展示给用户)

    • ⚠️ 重要:整个校验过程(包括形状描述、对比表格、校验轮次等)必须静默执行,禁止在对话输出中展示任何校验过程,只向用户展示最终确认的提取结果
    • 对第一轮提取结果中的所有数字串(手机号、订单号、金额、日期等),执行二次聚焦识别:
    • 策略 A:局部放大验证
      • 再次使用 read_image,但这次在 prompt 中只要求识别特定数字串区域
      • prompt 模板:「请只关注图片中的数字串 [上下文描述],逐位描述每个数字字符的视觉形状(有几个封闭圆圈、开口方向、弧线走向),然后给出最终判断结果」
    • 策略 B:交叉验证
      • 将第一轮的形状描述与第二轮的独立判断进行对比
      • 如果两轮结果一致 → 确认为最终结果
      • 如果两轮结果不一致 → 标注 [待确认:第一轮识别为X,第二轮识别为Y]
    • 易混淆数字对速查表:
      数字 关键视觉特征
      8 上下两个封闭圆圈,像雪人/沙漏
      6 仅下方一个封闭圆圈,顶部向左弯弧
      9 仅上方一个封闭圆圈,底部向下竖线
      0 完整封闭椭圆,无开口
      3 右侧开口,两个弧形朝右
      5 顶部横线+左侧竖线+下方圆弧
      S 类似5但上下对称,无横线
      O 比0更圆的封闭图形

Read the full file on GitHub · 314 lines

Files

What ships with it

6 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 · +157 lines · +102 tokens per session 80337aafb625
  2. 1mo ago First seen · 157 lines · 77 tokens per session scan A b0b05f2cedaf

Subscribe to this mod's changes

pdf-image-text-extractor is a skill published in the GitHub repository redfox-data/redfox-community-dsh (8 stars, last pushed 2d ago), licensed MIT. It adds 179 tokens to every session and 4,253 once invoked, about $0.0007 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.