This is a quadruple-engine OCR tool that pulls text from scanned PDFs and images. You get RapidOCR and PaddleOCR for local processing, RapidDoc for enhanced layout analysis with table and formula recognition, and SiliconFlow's API when you need cloud-based accuracy. The local engines run offline and free, while SiliconFlow taps into DeepSeek's OCR model for tougher jobs. It handles Chinese and English, converts PDF pages to images automatically, and falls back intelligently when one engine struggles. Good for processing contracts, scanned books, or batches of documents where you want flexibility between speed and precision without rewriting code.

skills.sh installs
439
GitHub stars
13
last updated
Jun 3, 2026

Install

$ npx -y skills add yejinlei/pdf-ocr-skill --skill pdf-ocr-skill --agent claude-code

Installs into .claude/skills of the current project.

Files

PDF OCR Skill

中文版本

PDF OCR技能用于从影印版PDF文件和图片文件中提取文字内容。该技能支持两种OCR引擎:

  • RapidOCR(本地引擎):无需API密钥,免费使用,识别速度快
  • 硅基流动大模型(云端引擎):使用AI大模型进行高精度OCR识别

功能特性

  • 支持影印版PDF文件的文字提取
  • 支持多种图片格式的文字识别(JPG、PNG、BMP、GIF、TIFF、WEBP)
  • 四引擎支持:RapidOCR(本地)、RapidDoc(增强)、PaddleOCR(本地)和硅基流动API(云端)
  • 支持中文和英文文字识别
  • 保持文字的顺序和结构
  • 自动将PDF页面转换为图片进行识别
  • 智能引擎切换:当RapidOCR初始化失败时自动切换到硅基流动API

安装

依赖要求
pip install pymupdf pillow requests python-dotenv
可选依赖(推荐)

安装RapidOCR以获得本地识别能力:

pip install rapidocr_onnxruntime

环境变量配置

  1. 复制 .env.example 文件并重命名为 .env
  2. 根据需要配置以下选项:
# OCR引擎选择
# - "rapid": 使用RapidOCR本地引擎(默认,无需API密钥)
# - "rapidoc": 使用RapidDoc增强引擎(无需API密钥)
# - "paddle": 使用PaddleOCR本地引擎(无需API密钥)
# - "siliconflow": 使用硅基流动API引擎(需要API密钥)
OCR_ENGINE=rapid

# 如果使用硅基流动API引擎,需要配置以下选项:
SILICON_FLOW_API_KEY=your_api_key_here
SILICON_FLOW_OCR_MODEL=deepseek-ai/DeepSeek-OCR

快速开始

使用默认引擎(RapidOCR本地识别)
# 导入OCR处理器
from scripts.pdf_ocr_processor import PDFOCRProcessor

# 创建处理器实例(默认使用RapidOCR)
processor = PDFOCRProcessor()

# 执行PDF OCR识别
result = processor.ocr_pdf('path/to/your/scanned.pdf')

Sponsors

Details

Repository
github.com/yejinlei/pdf-ocr-skill
Category
Office & Documents
First seen
Jun 3, 2026

More from yejinlei/pdf-ocr-skill

All 2
1larksuite avatarlark-sheetslarksuite/cli飞书电子表格:创建和操作电子表格。支持创建表格、管理工作表与行列结构(增删/合并/调整尺寸/隐藏/冻结)、读写单元格(值/公式/样式/批注/单元格图片)、查找替换、多操作原子批量更新,以及图表、透视表、条件格式、筛选器、迷你图、浮动图片等对象的创建与维护。当用户需要创建电子表格、管理工作表、批量读写或编辑数据、统计汇总484Kskills.sh installs
2claude-office-skills avatarhtml-to-pptclaude-office-skills/skillsConvert HTML/Markdown to PowerPoint presentations using Marp5.1Kskills.sh installs
3tfriedel avatarxlsxtfriedel/claude-office-skillsComprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work wit2.5Kskills.sh installs
4larksuite avatarlark-doclarksuite/cli飞书云文档(Docx / Wiki 文档):读取和编辑飞书文档内容。当用户给出文档 URL 或 token,或需要查看、创建、编辑文档、插入或下载文档图片附件时使用。文档中嵌入的电子表格、多维表格、画板,先用本 skill 提取 token 再切到对应 skill。当用户给出 doubao.com 的 /docx/ 或490.7Kskills.sh installs
5larksuite avatarlark-notelarksuite/cli飞书会议纪要(Note)直查:已知 note_id 时查询纪要详情、展示类型、关联文档 token,并读取 unified 原始逐字记录。当用户已持有 note_id,或从文档显式 vc-node-id 获得 note_id 时使用。不负责会议/日程/妙记定位、文档标题搜索或 Docx 正文读取。253.8Kskills.sh installs
6claude-office-skills avatarxlsx-manipulationclaude-office-skills/skillsCreate, edit, and manipulate Excel spreadsheets programmatically using openpyxl6.8Kskills.sh installs