ocr-and-documents

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

Updated Jun 5, 2026
One-click install
npx skills add https://github.com/xu1713/openhorse --skill ocr-and-documents-xu1713
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ocr-and-documents
Source: https://github.com/xu1713/openhorse/tree/main/openhorse/openhorse/skills/productivity/ocr-and-documents
Command: npx skills add https://github.com/xu1713/openhorse --skill ocr-and-documents-xu1713

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Extracting text from PDFs and scanned documents is inconsistent: some files are text-based, others are scanned images requiring OCR, and choosing the wrong tool wastes time or fails entirely. This Skill provides a decision workflow that routes each document to the right extractor. ## Core Features & Use Cases - Dual extraction engines: pymupdf for fast, lightweight text/table/image extraction from text-based PDFs, and marker-pdf for OCR of scanned documents, equations, forms, and complex layouts in 90+ languages. - Remote URL handling: tries web_extract first for documents hosted at URLs, avoiding local dependencies entirely. - PDF manipulation: split, merge, and search PDFs natively with pymupdf, plus metadata and page-range extraction. - Use Case: A researcher downloads a scanned arxiv paper with equations. The Skill checks disk space, runs marker-pdf via scripts/extract_marker.py, and returns clean Markdown with LaTeX equations preserved. ## 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 --markdown, --tables, or --pages flags. It installs in seconds at about 25MB and handles text-based PDFs instantly.

pymupdf vs marker-pdf: which PDF extractor should I use?

Use pymupdf for text-based PDFs, basic tables, and image extraction since it is lightweight and fast. Choose marker-pdf when you need OCR for scanned documents, equation or LaTeX recognition, forms, or complex layout analysis, accepting its 3-5GB install size.

Can pymupdf extract text from scanned PDF documents?

No, pymupdf cannot perform OCR on scanned PDFs because it only reads existing text layers. For scanned documents, use marker-pdf, which supports OCR across 90+ languages and also handles equations and forms.

How do I split or merge PDF files with Python?

Use pymupdf's insert_pdf method to copy selected pages into a new document for splitting, or combine multiple source documents into one for merging. No extra dependencies beyond pymupdf are required for these operations.

Why does marker-pdf installation fail or take so long?

marker-pdf requires roughly 5GB of disk space for PyTorch plus about 2.5GB of models downloaded to the HuggingFace cache on first use. Run extract_marker.py --check first to verify free space, or fall back to pymupdf if space is insufficient.