ocr-and-documents

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

Updated May 13, 2026
One-click install
npx skills add https://github.com/superfhp/lumi-agent-body --skill ocr-and-documents-superfhp
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ocr-and-documents
Source: https://github.com/superfhp/lumi-agent-body/tree/main/skills/productivity/ocr-and-documents
Command: npx skills add https://github.com/superfhp/lumi-agent-body --skill ocr-and-documents-superfhp

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 choosing the wrong tool wastes time or fails entirely. This Skill provides a decision workflow and ready-to-run scripts for extracting content from any PDF or document. ## 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 OCR, equations, forms, and complex layouts. - Full document operations: Extract text, markdown, tables, images, and metadata, plus split, merge, and search PDFs natively with pymupdf. - Use Case: You receive a scanned 50-page contract as a PDF. The Skill detects it needs OCR, checks disk space, and runs marker-pdf to produce clean markdown with preserved layout. ## Quick Start Extract all text from the attached file report.pdf using the appropriate extractor for its content type.

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 for plain text, markdown, tables, or metadata. It installs in seconds at about 25MB with no model downloads.

pymupdf vs marker-pdf: which should I use for PDF extraction?▼

Use pymupdf for text-based PDFs, basic tables, and image extraction since it is fast and lightweight. Use marker-pdf when you need OCR for scanned documents, equation and LaTeX recognition, forms, or reading-order detection, 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, or try web_extract if the document has a public URL.

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.

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 the script's --check flag to verify free disk space before installing.