| name | ocr-research |
| description | Extract text from any PDF — text-based, scanned, or with embedded images (receipts, photos). Local OCR using PyMuPDF + Tesseract. Supports English, Hindi, Sanskrit. |
OCR Research Documents
Extract text from PDFs locally using PyMuPDF (text extraction) and Tesseract OCR (scanned pages + embedded images).
Quick Start
cd ~/.agents/skills/ocr-research
bash bin/setup.sh
ocr bin/ocr <pdf_path>
ocr bin/ocr paper.pdf --pages 1-10
ocr bin/ocr receipt.pdf --lang eng
ocr bin/ocr sanskrit_doc.pdf --lang eng+san
ocr bin/ocr doc.pdf --dpi 400 --output output.txt
What It Handles
| PDF Type | Method | Speed |
|---|
| Text-based PDFs | PyMuPDF extraction | Instant |
| Scanned pages | Render → Tesseract OCR | ~2-5s/page |
| Embedded images | Extract each image → OCR | ~1-3s/image |
| Mixed content | Smart combo of all above | Varies |
Receipts, invoices, photos-in-PDFs, scanned academic papers — all work.
Languages
ocr bin/ocr doc.pdf --lang eng
ocr bin/ocr doc.pdf --lang eng+hin
ocr bin/ocr doc.pdf --lang eng+san
Options
--output, -o FILE Write to file instead of stdout
--pages, -p RANGE Page range: "1-5" or "1,3,7"
--lang, -l LANG Tesseract language(s) (default: eng)
--dpi, -d N DPI for rendering (default: 300, use 400+ for small text)
--verbose, -v Show progress
Setup (one-time)
The bin/setup.sh script installs:
- Python 3 (via system or brew)
- Tesseract 5 + language packs (brew)
- PyMuPDF in a local venv
bash bin/setup.sh
Examples
ocr bin/ocr DG_Oil_Payment.pdf
ocr bin/ocr paper.pdf --lang eng+san
ocr bin/ocr report.pdf --pages 3-7
ocr bin/ocr flyer.pdf --dpi 400 --output extracted.txt