🚀 快速安装
复制以下命令并运行,立即安装此 Skill:
npx skills add https://skills.sh/claude-office-skills/skills/pdf-ocr-extraction
💡 提示:需要 Node.js 和 NPM
PDF OCR 提取 (PDF OCR Extraction)
使用 OCR 技术从扫描文档和基于图像的 PDF 中提取文本。
概述 (Overview)
此技能帮助您:
- 从扫描文档中提取文本
- 使图像 PDF 可搜索
- 数字化纸质文档
- 处理手写文本(有限)
- 批量处理多个文档
使用方法 (How to Use)
基础 OCR (Basic OCR)
"从此扫描的 PDF 中提取文本 (Extract text from this scanned PDF)"
"对此文档图像进行 OCR (OCR this document image)"
"使此 PDF 可搜索 (Make this PDF searchable)"
带选项 (With Options)
"从第 1-10 页提取文本,英语 (Extract text from pages 1-10, English language)"
"对此文档进行 OCR,保留布局 (OCR this document, preserve layout)"
"提取并输出为结构化数据 (Extract and output as structured data)"
文档类型 (Document Types)
按文档类型的 OCR 质量 (OCR Quality by Document Type)
| 文档类型 (Document Type) | 预期质量 (Expected Quality) | 提示 (Tips) |
|---|---|---|
| 打字文档 (Typed documents) | ⭐⭐⭐⭐⭐ 95%+ | 效果最佳 (Best results) |
| 印刷书籍 (Printed books) | ⭐⭐⭐⭐ 90%+ | 注意老化纸张 (Watch for aging) |
| 表格 (Forms) | ⭐⭐⭐⭐ 85%+ | 复选框可能需要手动处理 (Check boxes may need manual) |
| 表格/数据 (Tables/Data) | ⭐⭐⭐ 80%+ | 结构可能需要修复 (Structure may need fixing) |
| 手写(整洁)(Handwritten – neat) | ⭐⭐ 60-80% | 结果可变 (Variable results) |
| 手写(草书)(Handwritten – cursive) | ⭐ 30-60% | 通常需要人工审核 (Often needs manual review) |
| 混合内容 (Mixed content) | ⭐⭐⭐ 75%+ | 取决于复杂度 (Depends on complexity) |
输出格式 (Output Formats)
纯文本提取 (Plain Text Extraction)
## OCR 结果:[文档名称] (OCR Result: [Document Name])
**已处理页数 (Pages Processed)**: [X]
**语言 (Language)**: [检测到/指定 (Detected/Specified)]
**置信度 (Confidence)**: [X]%
---
[此处为提取的文本内容 (Extracted text content here)]
---
### 备注 (Notes)
- [任何问题或不确定之处 (Any issues or uncertainties)]
- [可能错误的字符 (Characters that may be incorrect)]
结构化提取 (Structured Extraction)
## OCR 提取:[文档名称] (OCR Extraction: [Document Name])
### 文档信息 (Document Info)
| 字段 (Field) | 值 (Value) |
|-------|-------|
| 标题 (Title) | [提取或推断 (Extracted or inferred)] |
| 日期 (Date) | [如果找到 (If found)] |
| 作者 (Author) | [如果找到 (If found)] |
### 按章节的内容 (Content by Section)
#### [标题 1 (Header 1)]
[此标题下的内容 (Content under this header)]
#### [标题 2 (Header 2)]
[此标题下的内容 (Content under this header)]
### 找到的表格 (Tables Found)
| 列 1 (Column 1) | 列 2 (Column 2) | 列 3 (Column 3) |
|----------|----------|----------|
| [数据 (Data)] | [数据 (Data)] | [数据 (Data)] |
### 不确定的文本 (Uncertain Text)
| 页数 (Page) | 原文 (Original) | 置信度 (Confidence) | 可能 (Possible) |
|------|----------|------------|----------|
| 3 | "teh" | 70% | "the" |
| 5 | "l0ve" | 65% | "love" |
可搜索 PDF 输出 (Searchable PDF Output)
## OCR 转可搜索 PDF (OCR to Searchable PDF)
**源文件 (Source)**: [filename.pdf]
**输出文件 (Output)**: [filename_searchable.pdf]
### 处理摘要 (Processing Summary)
| 指标 (Metric) | 值 (Value) |
|--------|-------|
| 页数 (Pages) | [X] |
| 提取的单词数 (Words extracted) | [Y] |
| 平均置信度 (Average confidence) | [Z]% |
| 处理时间 (Processing time) | [T] 秒 (seconds) |
### 质量报告 (Quality Report)
- [X] 页置信度 95%+ ([X] pages with 95%+ confidence)
- [Y] 页置信度 80-94% ([Y] pages with 80-94% confidence)
- [Z] 页置信度 <80%(建议审查)([Z] pages with <80% confidence - review recommended)
### 可搜索性 (Searchability)
✅ 文档现在可进行文本搜索 (Document is now text-searchable)
✅ 保留原始图像 (Original images preserved)
✅ 在图像后添加了文本层 (Text layer added behind images)
预处理提示 (Pre-Processing Tips)
图像质量检查清单 (Image Quality Checklist)
在进行 OCR 之前,请确保:
- 分辨率 (Resolution): 最小 300 DPI(小文本使用 600)(300 DPI minimum – 600 for small text)
- 对比度 (Contrast): 白底黑字清晰 (Clear black text on white background)
- 对齐 (Alignment): 文档摆正(无倾斜)(Document is straight – not skewed)
- 完整性 (Completeness): 无切边 (No cut-off edges)
- 清洁度 (Cleanliness): 无污渍、标记或阴影 (No stains, marks, or shadows)
常见预处理步骤 (Common Pre-Processing Steps)
| 问题 (Issue) | 解决方案 (Solution) |
|---|---|
| 分辨率低 (Low resolution) | 先放大图像 (Upscale image first) |
| 倾斜/旋转 (Skewed/rotated) | 自动纠偏 (Auto-deskew) |
| 对比度差 (Poor contrast) | 调整色阶/阈值 (Adjust levels/threshold) |
| 噪点/斑点 (Noise/specks) | 应用降噪 (Apply noise reduction) |
| 阴影 (Shadows) | 压平光照 (Flatten lighting) |
| 彩色文档 (Color document) | 转换为灰度 (Convert to grayscale) |
语言支持 (Language Support)
支持的语言 (Supported Languages)
- 优秀 (Excellent): 英语、西班牙语、法语、德语、意大利语 (English, Spanish, French, German, Italian)
- 良好 (Good): 中文(简体/繁体)、日语、韩语 (Chinese – Simplified/Traditional, Japanese, Korean)
- 中等 (Moderate): 阿拉伯语、希伯来语(RTL 支持)、印地语 (Arabic, Hebrew – RTL support, Hindi)
- 基础 (Basic): 许多其他语言,质量各异 (Many others with varying quality)
多语言文档 (Multi-Language Documents)
"对此文档进行 OCR,自动检测语言 (OCR this document, detect language automatically)"
"提取文本,主要语言:英语,次要语言:中文 (Extract text, primary: English, secondary: Chinese)"
处理特定内容 (Handling Specific Content)
表格和复选框 (Forms and Checkboxes)
## 表单提取:[表单名称] (Form Extraction: [Form Name])
### 字段值 (Field Values)
| 字段 (Field) | 值 (Value) | 置信度 (Confidence) |
|-------|-------|------------|
| 姓名 (Name) | 张三 (John Smith) | 98% |
| 日期 (Date) | 2026-01-15 | 95% |
| 地址 (Address) | 123 主街 (123 Main St) | 92% |
### 复选框 (Checkboxes)
| 问题 (Question) | 已勾选 (Checked) |
|----------|---------|
| 选项 A (Option A) | ☑️ 是 (Yes) |
| 选项 B (Option B) | ☐ 否 (No) |
| 选项 C (Option C) | ☑️ 是 (Yes) |
### 签名 (Signature)
[在第 X 页检测到签名 - 无法提取文本] ([Signature detected on page X - cannot extract text])
表格 (Tables)
## 表格提取 (Table Extraction)
### 表格 1(第 2 页)(Table 1 - Page 2)
| 标题 A (Header A) | 标题 B (Header B) | 标题 C (Header C) |
|----------|----------|----------|
| 值 1 (Value 1) | 值 2 (Value 2) | 值 3 (Value 3) |
| 值 4 (Value 4) | 值 5 (Value 5) | 值 6 (Value 6) |
**表格置信度 (Table confidence)**: 85%
**注意 (Note)**: 第 3 列可能存在对齐问题 (Column 3 may have alignment issues)
手写文本 (Handwritten Text)
## 手写文本提取 (Handwritten Text Extraction)
**可读性评估 (Legibility Assessment)**: [良好/一般/差 (Good/Fair/Poor)]
**建议 (Recommended)**: 人工审核 (Manual review)
### 提取的文本(置信度:65%)(Extracted Text - Confidence: 65%)
[提取的文本,不确定的词已标记 (Extracted text with uncertain words marked)]
### 不确定的词 (Uncertain Words)
| 原文 (Original) | 最佳猜测 (Best Guess) | 备选 (Alternatives) |
|----------|------------|--------------|
| [图像] | "会议" | "会议", "意义" |
| [图像] | "星期二" | "星期二", "星期四" |
⚠️ **置信度低的提取结果 - 请手动验证 (Low confidence extraction - please verify manually)**
批量处理 (Batch Processing)
批量 OCR 任务 (Batch OCR Job)
## 批量 OCR 处理 (Batch OCR Processing)
**文件夹 (Folder)**: [路径 (Path)]
**总文档数 (Total Documents)**: [X]
**状态 (Status)**: [进行中/完成 (In Progress/Complete)]
### 结果 (Results)
| 文件 (File) | 页数 (Pages) | 置信度 (Confidence) | 状态 (Status) |
|------|-------|------------|--------|
| doc1.pdf | 5 | 96% | ✅ 完成 (Complete) |
| doc2.pdf | 12 | 88% | ✅ 完成 (Complete) |
| doc3.pdf | 3 | 72% | ⚠️ 需审查 (Review) |
| doc4.pdf | 8 | - | ❌ 失败 (Failed) |
### 问题 (Issues)
- doc3.pdf: 第 2-3 页有手写内容 (Pages 2-3 have handwriting)
- doc4.pdf: 文件损坏 (File corrupted)
### 摘要 (Summary)
- 成功 (Successful): [X]
- 需审查 (Need Review): [Y]
- 失败 (Failed): [Z]
工具推荐 (Tool Recommendations)
云服务 (Cloud Services)
- Google Cloud Vision(准确度极佳)(excellent accuracy)
- Amazon Textract(适合表格)(good for forms)
- Azure Computer Vision(平衡)(balanced)
- Adobe Acrobat(集成)(integrated)
桌面软件 (Desktop Software)
- ABBYY FineReader(准确度最佳)(best accuracy)
- Adobe Acrobat Pro(可靠)(reliable)
- Readiris(性价比高)(good value)
- Tesseract(免费,开源)(free, open source)
编程库 (Programming Libraries)
- pytesseract(Python + Tesseract)
- EasyOCR(Python,多语言)(Python, multi-language)
- PaddleOCR(Python,对亚洲语言友好)(Python, good for Asian languages)
局限性 (Limitations)
- 无法保证 100% 准确 (Cannot guarantee 100% accuracy)
- 手写文本准确率低 (Handwritten text has low accuracy)
- 非常小的文本可能提取不佳 (Very small text may not extract well)
- 装饰性字体存在问题 (Decorative fonts are problematic)
- 背景图像会降低质量 (Background images reduce quality)
- 无法读取复杂图形中的文本 (Cannot read text in complex graphics)
- 处理时间随页数增加 (Processing time increases with pages)
📄 原始文档
完整文档(英文):
https://skills.sh/claude-office-skills/skills/pdf-ocr-extraction
💡 提示:点击上方链接查看 skills.sh 原始英文文档,方便对照翻译。
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

评论(0)