ocr-and-documents

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Extracting usable text from PDFs and scanned documents is difficult because text-based PDFs, scanned images, tables, and equations each require different tools. 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 lightweight pymupdf for text-based PDFs, then marker-pdf for OCR, equations, forms, and complex layouts. - Full document operations: Extract text, Markdown, tables, embedded images, and metadata, plus split, merge, and search PDFs natively with pymupdf. - Use Case: You download a scanned arXiv paper with math equations. The Skill checks disk space, installs marker-pdf, and converts the PDF to Markdown with LaTeX equations and extracted figures. ## Quick Start Extract the full text of the attached scanned report.pdf as Markdown, using OCR if the document has no text layer.

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 (~25MB) and instant, handling text-based PDFs, basic tables, and embedded images. marker-pdf (~3-5GB with PyTorch) adds OCR for scanned documents in 90+ languages, equations, forms, and reading-order detection.

How to extract text from a scanned PDF with OCR?▼

Use marker-pdf, which performs OCR on scanned PDFs in over 90 languages and outputs Markdown. Run the extract_marker.py script on the file, but verify you have about 5GB free disk first since it downloads PyTorch and models.

Does pymupdf support OCR for scanned documents?▼

No, pymupdf cannot perform OCR on scanned images or convert images to text. For scanned documents, equations, or complex layouts, use marker-pdf instead, or provide a URL so web_extract can handle the conversion remotely.

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

Use pymupdf's insert_pdf method to copy page ranges into a new document for splitting, or combine multiple source files into one for merging. No extra dependencies are needed beyond pymupdf itself.

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 Hugging Face cache on first use. Run the script's --check flag to verify free space, or fall back to pymupdf for text-based PDFs.