ocr-and-documents

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

Updated Jul 7, 2026
One-click install
npx skills add https://github.com/episvr/USTB-2026-SummerInternship --skill ocr-and-documents-episvr
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ocr-and-documents
Source: https://github.com/episvr/USTB-2026-SummerInternship/tree/main/hermes-config/skills/productivity/ocr-and-documents
Command: npx skills add https://github.com/episvr/USTB-2026-SummerInternship --skill ocr-and-documents-episvr

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: text-based PDFs need lightweight parsing, while scanned pages, equations, and complex layouts require full OCR pipelines. This Skill routes each document to the right extractor so you get clean text or Markdown without trial and error. ## Core Features & Use Cases - Tiered extraction strategy: Try web_extract for remote URLs first, then pymupdf for text-based PDFs, then marker-pdf for scanned documents, equations, forms, and complex layouts. - Structured output: Extract plain text, Markdown, tables, embedded images, and document metadata, plus split, merge, and search PDFs natively with pymupdf. - Use Case: You receive a scanned 40-page contract PDF. The Skill checks disk space, runs marker-pdf OCR, and returns searchable Markdown with preserved tables and reading order. ## Quick Start Extract the text from the attached scanned PDF report and convert it to Markdown, keeping the tables intact.

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 pymupdf4llm to convert directly to Markdown. It installs in about 25MB and handles text-based PDFs, tables, images, and metadata without downloading models.

pymupdf vs marker-pdf for PDF extraction?▼

pymupdf is lightweight and instant, best for text-based PDFs, basic tables, and image extraction. marker-pdf handles scanned documents with OCR in 90+ languages, equations, forms, and reading order detection, but requires 3-5GB for PyTorch and models.

How to OCR a scanned PDF document?▼

Use marker-pdf, which performs OCR on scanned PDFs across 90+ languages and outputs Markdown with layout analysis. Run the extract_marker.py script on the file, optionally with --use_llm for higher accuracy or --json for structured output.

Does pymupdf work on scanned documents?▼

No, pymupdf cannot OCR scanned PDFs or convert images to text; it only extracts existing text layers and embedded images. For scanned documents, use marker-pdf or provide a URL so web_extract can handle the conversion.

Why does marker-pdf installation fail or run slowly?▼

marker-pdf needs roughly 5GB of free disk for PyTorch plus about 2.5GB of models downloaded to the HuggingFace cache on first use. Processing takes 1-14 seconds per page on CPU, so check disk space with the --check flag before installing.

How do I split or merge PDF files in Python?▼

pymupdf handles split and merge natively with no extra dependencies. Open the source PDF, create a new document, use insert_pdf with page ranges to split, or insert multiple documents sequentially to merge, then save the result.