Skip to content
Agentmart
Submit a tool

ocr-and-documents

Extract text from PDFs and scanned documents.

Skill by ez2k

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/ez2k-ocr-and-documents

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Extract text from PDFs and scanned documents. Use web_fetch for remote URLs, pymupdf for local text-based PDFs, marker-pdf for OCR/scanned docs. For DOCX use python-docx.

Use cases: documents, productivity

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/ocr-and-documents

What's inside

Skill name
ocr-and-documents
Description
Extract text from PDFs and scanned documents. Use web_fetch for remote URLs, pymupdf for local text-based PDFs, marker-pdf for OCR/scanned docs. For DOCX use python-docx.
License
MIT
Instructions
152 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# PDF & Document Extraction

For DOCX: use `python-docx` (parses actual document structure, far better than OCR).
This skill covers **PDFs and scanned documents**.

## Step 1: Remote URL Available?

If the document has a URL, **always try `web_fetch` first**:

```
web_fetch("https://arxiv.org/pdf/2402.03300")
web_fetch("https://example.com/report.pdf")
```

This handles PDF-to-text conversion with no local dependencies.

Only use local extraction when: the file is local, web_fetch fails, or you need batch processing.

## Step 2: Choose Local Extractor

| Feature | pymupdf (~25MB) | marker-pdf (~3-5GB) |
|---------|-----------------|---------------------|
| **Text-based PDF** | Yes | Yes |
| **Scanned PDF (OCR)** | No | Yes (90+ languages) |
| **Tables** | Yes (basic) | Yes (high accuracy) |
| **Equations / LaTeX** | No | Yes |
| **Code blocks** | No | Yes |
| **Markdown output** | Yes (via pymupdf4llm) | Yes (native) |
| **Install size** | ~25MB | ~3-5GB (PyTorch + models) |
| **Speed** | Instant | ~1-14s/page (CPU) |

**Decision**: Use pymupdf unless you need OCR, equations, or complex layout analysis.

---

## pymupdf (lightweight)

```bash
pip install pymupdf pymupdf4llm
```

**Extract text:**
```bash
python3 -c "
import pymupdf
doc = pymupdf.open('document.pdf')
for page in doc:
    print(page.get_text())
"
```

**Extract as markdown:**
```bash
python3 -c "
import pymupdf4llm
md_text = pymupdf4llm.to_markdown('document.pdf')
print(md_text)
"
```

**Extract specific pages:**
```bash
python3 -c "
import pymupdf
doc = pymupdf.open('document.pdf')
for i in range(min(5, len(doc))):
    print(f'--- Page {i+1} ---')
    print(doc[i].get_text())
"
```

---

## marker-pdf (high-quality OCR)

```bash
pip install marker-pdf
```

**CLI usage:**
```bash
marker_single document.pdf --output_dir ./output
marker /path/to/folder --workers 4    # Batch
```

**Check disk space first** (~5GB needed for PyTorch + models):
```bash
df -h ~
```

---

## Split, Merge & Search

pymupdf handles these natively:

```python
# Split: extract pages 1-5 to a new PDF
import pymupdf
doc = pymupdf.open("report.pdf")
new = pymupdf.open()
for i in range(5):
    new.insert_pdf(doc, from_page=i, to_page=i)
new.save("pages_1-5.pdf")
```

```python
# Merge multiple PDFs
import pymupdf
result = pymupdf.open()
for path in ["a.pdf", "b.pdf", "c.pdf"]:
    result.insert_pdf(pymupdf.open(path))
result.save("merged.pdf")
```

```python
# Search for text across all pages
import pymupdf
doc = pymupdf.open("report.pdf")

From ez2k/claude-channel-hub, MIT.

More from ez2k/claude-channel-hub

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Apr 14, 2026 (6 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from ez2k

Cite this page

ocr-and-documents skill. Agent Mart. https://agentmart.dev/skills/ez2k-ocr-and-documents (last updated 2026-10-24)