ocr-and-documents

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

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

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 produces garbled output. This Skill provides a decision workflow that routes each document to the right extractor. ## Core Features & Use Cases - Lightweight extraction with pymupdf: Pull text, markdown, tables, images, and metadata from text-based PDFs with a ~25MB install, plus split, merge, and search operations. - High-quality OCR with marker-pdf: Handle scanned documents, equations, forms, and complex layouts in 90+ languages, with optional LLM-boosted accuracy. - Remote URL extraction: Use web_extract first for documents hosted online, avoiding local dependencies entirely. - Use Case: You receive a scanned research paper as a PDF. The Skill checks disk space, installs marker-pdf, and converts the document to clean markdown with extracted images. ## Quick Start Extract the text from my local file report.pdf and convert it to markdown.

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 the file path. For markdown output, install pymupdf4llm and use the --markdown flag.

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

Use pymupdf for text-based PDFs since it is only ~25MB and runs instantly. Use marker-pdf when you need OCR for scanned documents, equation extraction, forms, or complex layout analysis, but it requires ~3-5GB for PyTorch and models.

Can pymupdf extract text from scanned PDF documents?

No, pymupdf cannot perform OCR on scanned documents since it only reads existing text layers. For scanned PDFs, use marker-pdf, which supports OCR in over 90 languages.

How do I extract tables from a PDF file?

Run extract_pymupdf.py with the --tables flag, which uses pymupdf's find_tables() to detect tables and outputs them as markdown via pandas. For higher accuracy on complex tables, marker-pdf provides better results.

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

marker-pdf requires ~3-5GB of disk space for PyTorch and downloads ~2.5GB of models to ~/.cache/huggingface/ on first use. Run extract_marker.py --check first to verify you have at least 5GB free.

How do I extract text from a PDF hosted at a URL?

Use web_extract with the document URL, which converts PDFs to markdown via Firecrawl without any local dependencies. Only fall back to local extraction with pymupdf or marker-pdf if web_extract fails or the file is local.