ocr-and-documents

Extract text, tables, and images from PDFs and scanned documents using pymupdf or marker-pdf.

2|Updated Oct 20, 2017
One-click install
npx skills add https://github.com/rbudiharso/dotfiles --skill ocr-and-documents-rbudiharso
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ocr-and-documents
Source: https://github.com/rbudiharso/dotfiles/tree/main/hermes/.hermes/skills/productivity/ocr-and-documents
Command: npx skills add https://github.com/rbudiharso/dotfiles --skill ocr-and-documents-rbudiharso

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pymupdf, pymupdf4llm, marker-pdf, and includes scripts (resource) components.

What problem does it solve? Getting usable text out of PDFs and scanned documents is inconsistent: some files are text-based, others are scanned images requiring OCR, and complex layouts with tables or equations break simple extractors. This Skill provides a decision workflow for choosing the right extraction method for each document type. ## Core Features & Use Cases - Tiered extraction strategy: Try web_extract for remote URLs first, then lightweight pymupdf for text-based PDFs, then marker-pdf for scanned documents, OCR, equations, and complex layouts. - Helper scripts: Run extract_pymupdf.py for text, markdown, tables, images, and metadata, or extract_marker.py for high-quality OCR with JSON output and image saving. - PDF utilities: Split, merge, and search PDFs natively with pymupdf, plus dedicated handling for Arxiv papers via abstract or full-text URLs. - Use Case: You receive a scanned 50-page contract as a PDF. The Skill checks disk space, installs marker-pdf, and converts the document to clean markdown with OCR across 90+ languages. ## Quick Start Extract the text from my local file report.pdf, using OCR if it turns out to be a scanned document.

Frequently Asked Questions about ocr-and-documents

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract text from a PDF in Python?▼

Use pymupdf to open the PDF and call get_text() on each page, or run the extract_pymupdf.py script with optional flags for markdown, tables, images, or specific page ranges. It installs in seconds at about 25MB.

pymupdf vs marker-pdf for PDF extraction?▼

pymupdf is lightweight (~25MB) and instant, handling text-based PDFs, tables, and images. marker-pdf (~3-5GB with PyTorch) adds OCR for scanned documents in 90+ languages, equation and LaTeX support, and reading-order detection.

How do I extract text from a scanned PDF?▼

Scanned PDFs require OCR, which pymupdf cannot do. Use marker-pdf via the extract_marker.py script, which performs OCR in over 90 languages and outputs markdown, optionally with LLM-boosted accuracy.

Does marker-pdf work without a GPU?▼

Yes, marker-pdf runs on CPU at roughly 1-14 seconds per page, compared to about 0.2 seconds per page on GPU. It requires around 5GB of free disk space for PyTorch and models downloaded on first use.

Why does PDF text extraction return empty output?▼

Empty output usually means the PDF is a scanned image without a text layer, so standard parsers find nothing. Switch to an OCR-based extractor like marker-pdf, or use web_extract if the document has a public URL.