Xpersona
P

PDF和图片文字提取

CLAWHUB · Unverified

从图片或 PDF 文档中识别并提取文字内容,支持多种图片格式和 PDF 文件,自动判断是否包含文字并保留原始格式输出结构化结果;v2.1 采用零额外依赖方案:扫描版 PDF 自动渲染为图片交由 AI 视觉识别(无需 tesseract/rapidocr)、表格用 pymupdf 内置 find_tables 结构化提取(无需 pdfplumber)、批量处理目录(PDF+图片一次性提取);当用户需要从图片或 PDF 提取文字、进行 OCR 识别、处理含文字的文档、提取 PDF 表格、批量处理文件夹或转换为可编辑文本时使用。该skill能力来自RedFoxHub,官网:https://redfo Skill: PDF和图片文字提取 Owner: yuanyi-github Summary: 从图片或 PDF 文档中识别并提取文字内容,支持多种图片格式和 PDF 文件,自动判断是否包含文字并保留原始格式输出结构化结果;v2.1 采用零额外依赖方案:扫描版 PDF 自动渲染为图片交由 AI 视觉识别(无需 tesseract/rapidocr)、表格用 pymupdf 内置 find_tables 结构化提取(无需 pdfplumber)、批量处理目录(PDF+图片一次性提取);当用户需要从图片或 PDF 提取文字、进行 OCR 识别、处理含文字的文档、提取 PDF 表格、批量处理文件夹或转换为可编辑文本时使用。该skill能力来自RedFoxHub,官网:https://redfo Tags: latest:1.0.6 Version history: v1.0.6 | 2026-09-09T07:00:06.995Z |

62
Rank
84
Safety
1.4k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.4K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s178m9shhypj2frsz7r1pz67kh84rb1r:image-text-extractor
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-yuanyi-github-image-text-extractor/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

91,785 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: pdf-image-text-extractor
slug: pdf-image-text-extractor
version: 2.1.0
displayName: PDF和图片文字提取
description: 从图片或 PDF 文档中识别并提取文字内容,支持多种图片格式和 PDF 文件,自动判断是否包含文字并保留原始格式输出结构化结果;v2.1 采用零额外依赖方案:扫描版 PDF 自动渲染为图片交由 AI 视觉识别(无需 tesseract/rapidocr)、表格用 pymupdf 内置 find_tables 结构化提取(无需 pdfplumber)、批量处理目录(PDF+图片一次性提取);当用户需要从图片或 PDF 提取文字、进行 OCR 识别、处理含文字的文档、提取 PDF 表格、批量处理文件夹或转换为可编辑文本时使用。该skill能力来自RedFoxHub,官网:https://redfox.hk/skills。
dependency:
  python:
    - pymupdf>=1.23.0
    - requests>=2.28.0
---

# PDF和图片文字提取

## 任务目标

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

## 🔑 鉴权

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

前往 [红狐hub](https://redfox.hk/settings/api-keys?source=clawhub) 注册获取个人 API Key,通过以下任一方式配置:

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

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

> ⚠️ 执行提取前先运行 `python3 scripts/record.py` 请求使用权限。
> 脚本非零退出(未配置 Key 或接口失败)时**立即停止**,只向用户说明:本 Skill 需凭红狐 API Key 获取使用权限,Key 免费且不扣积分,可前往 [红狐hub](https://redfox.hk/settings/api-keys?source=clawhub) 领取。
> 不要向用户复述脚本命令、退出码、接口报错或环境变量写法——具体配置方式由 `record.py` 的输出自行提示。

## 前置准备

### 必要依赖

```
pymupdf>=1.23.0
requests>=2.28.0
```

```bash
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:鉴权检查(必须首先执行)

```bash
python3 scripts/record.py
```

- 输出 `✅ 鉴权通过,已获得使用权限` → 继续后续流程
- 脚本以非零退出码终止 → **立即停止**,向用户展示脚本输出的错误提示,告知需前往 [红狐hub](https://redfox.hk/settings/api-keys?source=clawhub) 免费获取 API Key

#### Step 0.5:版本更新提示(每次执行)

```bash
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** 

README.md

# PDF和图片文字提取 / pdf-image-text-extractor

---

## 简介

上传图片或 PDF,自动识别并提取其中的文字内容;支持扫描版 PDF 识别、表格结构化提取与批量目录处理,保留原文结构与排版,输出清晰易读的结果。

**核心价值**

- **即传即识**:上传图片或 PDF,无需额外操作,自动完成文字识别与提取。
- **零额外依赖**:扫描识别与表格提取无需安装任何 OCR 引擎或表格库,开箱即用。
- **格式保留**:尽量保持原文的段落结构、标题层级,提取结果可直接使用。
- **完全免费**:仅需免费申请 API Key 用于权限校验,不扣积分。

**适用对象**

- 📄 **办公人员** — 快速从扫描件、合同、报告中提取文字,告别逐字手打。
- 📊 **财务 / 运营** — 一键把 PDF 里的表格提取成 Markdown,直接粘贴使用。
- 📚 **学生 / 研究者** — 从文献 PDF 中提取内容,方便整理笔记与引用。
- ✍️ **内容创作者** — 从图片素材中获取文字参考,提升创作效率。

---

## 功能特性

### 核心功能

- **图片文字提取**:上传图片即可识别其中所有文字,包括标题、正文、注释等。
- **PDF 文字提取**:自动解析 PDF 页面文字,多页文档一次性处理。
- **扫描版 PDF 识别**:自动检测无文字层的扫描页,渲染为高清图片后交由 AI 视觉识别,无需安装 OCR 引擎。
- **表格结构化提取**:自动识别 PDF 中的表格,输出 Markdown 表格格式,保留行列结构。
- **批量目录处理**:传入目录路径,一次性处理其中所有 PDF 与图片文件。
- **结构化输出**:结果以清晰的 Markdown 格式呈现,方便复制或导出。

---

## 密钥获取与安全说明

- 本技能需要使用环境变量:`REDFOX_API_KEY`。
- `REDFOX_API_KEY` 由 [红狐 hub](https://redfox.hk/settings/api-keys?source=clawhub) (`https://redfox.hk`)提供。
- 请前往 [红狐 hub](https://redfox.hk?source=clawhub) 注册账号,获取 `REDFOX_API_KEY`。
- 配置设备环境变量 `REDFOX_API_KEY` 后使用本技能。
- 在提供密钥前,请先确认密钥来源、可用范围、有效期及是否支持重置/撤销。
- 禁止在代码、提示词、日志或输出文件中硬编码/明文暴露密钥。

---

## 使用指南

直接用自然语言描述需求即可,无需记忆命令。

### 常用说法速查

| 意图           | 示例话术                           | 效果                                 |
| -------------- | ---------------------------------- | ------------------------------------ |
| 提取图片文字   | 上传图片后说"提取图片里的文字"     | 自动识别并输出图片中的所有文字内容   |
| 提取 PDF 文字  | 上传 PDF 后说"把这个 PDF 转文字"   | 自动解析所有页面,保留段落结构输出   |
| 扫描版识别     | 上传扫描件后说"识别这份扫描版的文字" | 自动将扫描页渲染为图片并识别出文字   |
| 提取 PDF 表格  | "把这份 PDF 里的表格提取出来"      | 输出结构化 Markdown 表格,可直接粘贴 |
| 批量处理       | "提取这个文件夹里所有文件的文字"   | 一次性处理目录下全部 PDF 与图片      |
| 保存提取结果   | "把提取结果保存下来"               | 生成 Markdown 文件,方便后续使用     |

### 输出示例

提取完成后,你将看到类似以下格式的内容:

```markdown
## 页面 1

所有经历的纠缠
还有难过的遗憾
都不可能没有意义

---

## 页面 2

| 产品 | 数量 | 营收 |
| --- | --- | --- |
| Alpha | 1200 | 36000 |
| Beta | 860 | 25800 |
```

PDF 多页文档以 `---` 分隔不同页面;表格以标准 Markdown 表格输出。

---

## 使用场景

| 场景         | 角色          | 示例问法                         | 收益                               |
| ------------ | ------------- | -------------------------------- | ---------------------------------- |
| 文档数字化   | 办公人员      | "把这份合同 PDF 转成文字"        | 告别逐字手打,快速完成文档电子化   |
| 扫描件识别   | 办公 / 档案   | "识别这份扫描件里的文字"         | 无需安装 OCR 软件,AI 直接识别     |
| 表格提取     | 财务 / 运营   | "把这份报表 PDF 的表格抽出来"    | 直接得到 Markdown 表格,便于二次处理 |
| 资料归档     | 个人用户      | "提取这个文件夹里所有文件的文字" | 整目录一次处理,省时省力           |
| 文献整理     | 学生 / 研究者 | "提取这篇论文 PDF 的内容"        | 方便做笔记、引用和检索             |

---

_meta.json

{
  "ownerId": "kn70p3je4506z0tw213zgq0r4584s0c6",
  "slug": "image-text-extractor",
  "version": "1.0.6",
  "publishedAt": 1788937206995
}

README.en.md

# PDF & Image Text Extractor / pdf-image-text-extractor

---

## Overview

Upload an image or PDF and automatically recognize and extract the text content within. It supports scanned-PDF recognition, structured table extraction, and batch directory processing, preserving the original structure and layout for clear, readable output.

**Core Value**

- **Instant recognition**: Upload an image or PDF—no extra steps needed, text extraction happens automatically.
- **Zero extra dependencies**: Scanned recognition and table extraction require no OCR engine or table library—ready to use out of the box.
- **Format preservation**: Paragraph structure and heading hierarchy are retained wherever possible, so results are ready to use.
- **Completely free**: Only a free API Key is needed for permission verification—no credits deducted.

**Intended Users**

- 📄 **Office workers** — Quickly extract text from scanned documents, contracts, and reports—no more manual retyping.
- 📊 **Finance / operations** — Turn PDF tables into Markdown in one click, ready to paste.
- 📚 **Students / researchers** — Pull content from academic PDFs for easier note-taking and citation.
- ✍️ **Content creators** — Grab text references from image assets to speed up your workflow.

---

## Features

### Core Capabilities

- **Image text extraction**: Upload an image to recognize all text within it—titles, body text, annotations, and more.
- **PDF text extraction**: Automatically parses text from PDF pages, processing multi-page documents in one pass.
- **Scanned-PDF recognition**: Automatically detects text-less scanned pages, renders them as high-resolution images, and recognizes them with AI vision—no OCR engine to install.
- **Structured table extraction**: Automatically recognizes tables in PDFs and outputs them as Markdown tables, preserving row and column structure.
- **Batch directory processing**: Pass in a directory path to process all PDF and image files inside in one go.
- **Structured output**: Results are presented in clean Markdown format for easy copying or exporting.

---

## API Key Acquisition & Security

- This skill requires the environment variable: `REDFOX_API_KEY`.
- `REDFOX_API_KEY` is issued by [RedFoxHub](https://redfox.hk/settings/api-keys?source=clawhub) (`https://redfox.hk`).
- Register at [RedFoxHub](https://redfox.hk?source=clawhub) to obtain `REDFOX_API_KEY`.
- Configure `REDFOX_API_KEY` on your device before using this skill.
- Before providing a key, confirm its source, scope of use, validity period, and whether it can be reset or revoked.
- Never hardcode or expose the key in plaintext in code, prompts, logs, or output files.

---

## Usage Guide

Simply describe what you need in natural language—no commands to memorize.

### Quick Reference

| Intent                     | Example phrase                                  | Result                                                          |
| -------------------------- | --------------------------------

skill-card.md

## Description:

Extracts text from images and PDFs, including scanned PDF pages, PDF tables, and batches of documents, with results organized for copying or saving.

This skill is ready for commercial/non-commercial use.

## Publisher:

[yuanyi-github](https://clawhub.ai/user/yuanyi-github)

### License/Terms of Use:

MIT-0

## Use Case:

Employees, external users, and developers use this skill to extract readable text and Markdown tables from uploaded images, PDFs, scanned documents, and folders of mixed PDF/image files. It is useful for document digitization, report/table extraction, notes, citations, and content reuse when the user accepts the RedFox API-key and vision-processing requirements.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: The server security summary rates the release as suspicious because it requires a RedFox API key and performs a remote permission check before local processing.

Mitigation: Review before installing, use a revocable RedFox API key, confirm the key source and scope, and avoid exposing the key in prompts, logs, code, or output files.

Risk: Document pages or images may be handled by the agent's vision tooling, which can be inappropriate for confidential or regulated documents.

Mitigation: Avoid confidential documents unless external vision processing is acceptable for the use case and workspace policy.

Risk: The skill can create local OCR page images and Markdown output files, while the security summary notes that file-writing behavior is understated.

Mitigation: Run the skill in a constrained workspace, choose output directories deliberately, review generated files, and remove temporary OCR images when they are no longer needed.

Risk: The skill depends on local Python packages and processes user-selected files or directories.

Mitigation: Use pinned dependencies where possible and limit execution to trusted files and expected directories.

## Reference(s):

- [ClawHub skill page](https://clawhub.ai/yuanyi-github/skills/image-text-extractor)
- [RedFoxHub skills](https://redfox.hk/skills)
- [RedFoxHub API key settings](https://redfox.hk/settings/api-keys?source=clawhub)

## Skill Output:

**Output Type(s):** [text, markdown, JSON, shell commands, configuration, guidance, files]

**Output Format:** [Markdown text, JSON extraction results, and optional local Markdown or rendered image files]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [PDF tables are emitted as Markdown tables; scanned pages and image inputs can be listed for agent vision processing.]

## Skill Version(s):

1.0.6 (source: server release metadata; artifact frontmatter reports 2.1.0)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to PDF和图片文字提取 and adjacent AI workflows.