
Pdf Ocr Skill
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-codeInstalls 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
环境变量配置
- 复制
.env.example文件并重命名为.env - 根据需要配置以下选项:
# 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