ocr-and-documents

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

Updated Jun 7, 2026
One-click install
npx skills add https://github.com/Chensihakniroth/ANAKOT-AGENT --skill ocr-and-documents-chensihakniroth
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ocr-and-documents
Source: https://github.com/Chensihakniroth/ANAKOT-AGENT/tree/main/skills/productivity/ocr-and-documents
Command: npx skills add https://github.com/Chensihakniroth/ANAKOT-AGENT --skill ocr-and-documents-chensihakniroth

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 have clean text layers, others are image-only scans requiring OCR, and complex layouts with tables or equations break naive extraction. This Skill provides a decision workflow for choosing the right extraction tool for each document type. ## 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 scanned documents, OCR in 90+ languages, equations, 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 an arxiv paper and a scanned contract. Use web_extract on the arxiv URL for instant markdown, then run marker-pdf on the scanned contract to OCR its pages into structured text. ## Quick Start Extract the text from the attached file report.pdf, using OCR if it turns out to be a scanned document.

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 for markdown output. For remote PDF URLs, try web_extract first since it converts PDFs to markdown without local dependencies.

pymupdf vs marker-pdf for PDF extraction?▼

pymupdf is lightweight at ~25MB and handles text-based PDFs, tables, and image extraction instantly. marker-pdf requires ~3-5GB for PyTorch and models but adds OCR for scanned documents, equations, forms, and reading order detection.

How to OCR a scanned PDF document?▼

Use marker-pdf, which supports OCR in over 90 languages for scanned PDFs. Run the extract_marker.py script on the file, and it outputs markdown with optional JSON metadata and extracted images.

Does pymupdf work on scanned documents?▼

No, pymupdf cannot perform OCR on scanned PDFs or convert images to text. It only extracts existing text layers and embedded images, so scanned documents require marker-pdf instead.

Why does marker-pdf installation fail or get skipped?▼

marker-pdf needs roughly 5GB of free disk space for PyTorch plus ~2.5GB of models downloaded to the HuggingFace cache on first use. Run the script with --check to verify disk space before installing.

How do I extract text from DOCX or PPTX files?▼

Use python-docx for Word documents since it parses the actual document structure rather than relying on OCR. For PowerPoint files, use python-pptx, which supports full slide and notes extraction.