ocr-and-documents

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

Updated Jul 10, 2026
One-click install
npx skills add https://github.com/AvaTar-ArTs/.Agent-skills --skill ocr-and-documents-avatar-arts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ocr-and-documents
Source: https://github.com/AvaTar-ArTs/.Agent-skills/tree/main/skills/productivity/ocr-and-documents
Command: npx skills add https://github.com/AvaTar-ArTs/.Agent-skills --skill ocr-and-documents-avatar-arts

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 PDFs, scans, and EPUB files. ## 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. - Helper scripts: Run extract_pymupdf.py for text, markdown, tables, images, metadata, and page ranges; run extract_marker.py for high-quality OCR with JSON output, image saving, and optional LLM-boosted accuracy. - PDF manipulation: Split, merge, and search PDFs natively with pymupdf, no extra dependencies. - Use Case: You receive a scanned 40-page contract as a PDF. The Skill detects it needs OCR, checks disk space, and runs marker-pdf to produce clean markdown with preserved tables and reading order. ## Quick Start Extract all text and tables from the attached report.pdf, using OCR if the document turns out to be a scanned file.

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

pymupdf vs marker-pdf for PDF extraction?

pymupdf is lightweight and instant, handling text-based PDFs, tables, and embedded images. marker-pdf is a 3-5GB install that adds OCR for scanned documents in 90+ languages, equation and LaTeX extraction, forms, and reading-order detection.

How do I OCR a scanned PDF document?

Use marker-pdf via the extract_marker.py script, which performs OCR on scanned PDFs and outputs markdown. Check disk space first with the --check flag, since PyTorch and models require about 5GB.

Can pymupdf extract text from scanned PDFs?

No, pymupdf cannot perform OCR on scanned documents or image-based pages. For scanned files, use marker-pdf, 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 PDFs into one for merging. No additional libraries beyond pymupdf are needed.

Why does marker-pdf fail to install or run?

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