ocr-and-documents

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

5|2|Updated May 26, 2026
One-click install
npx skills add https://github.com/perasyudha/Nyxora --skill ocr-and-documents-perasyudha
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ocr-and-documents
Source: https://github.com/perasyudha/Nyxora/tree/main/packages/core/playbooks/productivity/ocr-and-documents
Command: npx skills add https://github.com/perasyudha/Nyxora --skill ocr-and-documents-perasyudha

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 for picking the right extractor and running it correctly. ## 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 PDF operations: Extract text, markdown, tables, images, and metadata, plus split, merge, and search PDFs using pymupdf with no extra dependencies. - Use Case: You receive a scanned 40-page contract PDF. The Skill detects that pymupdf cannot OCR it, checks disk space, installs marker-pdf, and converts the document to clean markdown with preserved tables and reading order. ## Quick Start Extract the text from my local 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. It installs in seconds at 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 but cannot OCR scanned pages, equations, or forms. marker-pdf (~3-5GB with PyTorch) handles OCR in 90+ languages, LaTeX equations, and complex layouts at roughly 1-14 seconds per page on CPU.

How do I extract text from a scanned PDF?

Scanned PDFs require OCR, which pymupdf does not support. Use marker-pdf, which performs OCR in over 90 languages and outputs markdown; check for about 5GB of free disk space before installing since it downloads PyTorch and models.

Can I extract tables from a PDF document?

Yes. pymupdf's find_tables() detects tables and converts them to pandas DataFrames for basic cases. For high-accuracy table extraction in complex layouts, marker-pdf produces better structured markdown output.

Why does PDF text extraction return empty output?

Empty output usually means the PDF is a scanned image with no text layer, so standard parsers find nothing. Switch to an OCR-capable tool like marker-pdf, or if the document has a URL, try web_extract first.

How do I merge or split PDF files in Python?

pymupdf handles both natively with no extra dependencies. Use insert_pdf() to copy page ranges into a new document for splitting, or to combine multiple files for merging, then save the result.