ocr-and-documents

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

Updated Jul 28, 2026
One-click install
npx skills add https://github.com/christian-byrne/comfy-skills --skill ocr-and-documents-christian-byrne
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ocr-and-documents
Source: https://github.com/christian-byrne/comfy-skills/tree/main/skills/ocr-and-documents
Command: npx skills add https://github.com/christian-byrne/comfy-skills --skill ocr-and-documents-christian-byrne

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pymupdf, marker-pdf, python-docx.

What problem does it solve? Reading text out of PDFs and scanned documents is inconsistent: text-based PDFs need a fast parser, while scanned pages and complex layouts require OCR. This Skill routes each document to the right tool and also covers splitting, merging, searching PDFs, and reading DOCX files. ## Core Features & Use Cases - Tool Selection Decision Flow: Chooses between pymupdf (fast, ~25MB, text-based PDFs) and marker-pdf (OCR, ~3-5GB, scanned or complex layouts with equations and tables). - PDF Manipulation: Split large PDFs into single pages, merge multiple PDFs, search for keywords, and extract embedded images with pymupdf. - OCR Conversion: Convert scanned PDFs to Markdown with marker-pdf, including batch directory processing with parallel workers. - Use Case: Given a folder of scanned invoices, run marker-pdf to convert each to Markdown, then search the output for invoice totals. ## Quick Start Extract all the text from the attached PDF file, 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 (imported as fitz) to open the PDF and call page.get_text() on each page. It handles text-based PDFs quickly and also supports searching, splitting, merging, and image extraction.

pymupdf vs marker-pdf for PDF text extraction?▼

pymupdf is about 100x faster and only ~25MB, making it right for text-based PDFs with selectable text. marker-pdf performs OCR and handles scanned pages, equations, and tables, but requires 3-5GB of disk and significant RAM.

How do I OCR a scanned PDF document?▼

Install marker-pdf and run marker_single on the file, or marker on a directory for batch conversion with multiple workers. It outputs Markdown and supports language selection via the --langs option.

Can I extract text from a PDF at a URL?▼

Try read_web_page first, since it handles many PDFs including arXiv papers directly. Only download and process the file locally with pymupdf or marker-pdf if that approach fails.

Why is marker-pdf slow or using too much memory?▼

marker-pdf runs OCR models that need several GB of disk and RAM, so it is inherently heavy. For large documents, process page-by-page, and only use it when the PDF is scanned or has complex layouts that pymupdf cannot handle.