ocr-and-documents
Extract text from PDFs and scanned documents.
Skill by Martin-Hausleitner
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/martin-hausleitner-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.
About
Use cases: documents, presentations, productivity
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
ocr-and-documents- Description
- Extract text from PDFs and scanned documents. Use web_extract for remote URLs, pymupdf for local text-based PDFs, marker-pdf for OCR/scanned docs. For DOCX use python-docx, for PPTX see the powerpoint skill.
- License
- MIT
- Instructions
- 161 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (4)
- DESCRIPTION.md
- SKILL.md
- extract_marker.py · scripts/
- extract_pymupdf.py · scripts/
SKILL.md (first lines)
# PDF & Document Extraction
For DOCX: use `python-docx` (parses actual document structure, far better than OCR).
For PPTX: see the `powerpoint` skill (uses `python-pptx` with full slide/notes support).
This skill covers **PDFs and scanned documents**.
## Step 1: Remote URL Available?
If the document has a URL, **always try `web_extract` first**:
```
web_extract(urls=["https://arxiv.org/pdf/2402.03300"])
web_extract(urls=["https://example.com/report.pdf"])
```
This handles PDF-to-markdown conversion via Firecrawl with no local dependencies.
Only use local extraction when: the file is local, web_extract fails, or you need batch processing.
## Step 2: Choose Local Extractor
| Feature | pymupdf (~25MB) | marker-pdf (~3-5GB) |
|---------|-----------------|---------------------|
| **Text-based PDF** | ✅ | ✅ |
| **Scanned PDF (OCR)** | ❌ | ✅ (90+ languages) |
| **Tables** | ✅ (basic) | ✅ (high accuracy) |
| **Equations / LaTeX** | ❌ | ✅ |
| **Code blocks** | ❌ | ✅ |
| **Forms** | ❌ | ✅ |
| **Headers/footers removal** | ❌ | ✅ |
| **Reading order detection** | ❌ | ✅ |
| **Images extraction** | ✅ (embedded) | ✅ (with context) |
| **Images → text (OCR)** | ❌ | ✅ |
| **EPUB** | ✅ | ✅ |
| **Markdown output** | ✅ (via pymupdf4llm) | ✅ (native, higher quality) |
| **Install size** | ~25MB | ~3-5GB (PyTorch + models) |
| **Speed** | Instant | ~1-14s/page (CPU), ~0.2s/page (GPU) |
**Decision**: Use pymupdf unless you need OCR, equations, forms, or complex layout analysis.
If the user needs marker capabilities but the system lacks ~5GB free disk:
> "This document needs OCR/advanced extraction (marker-pdf), which requires ~5GB for PyTorch and models. Your system has [X]GB free. Options: free up space, provide a URL so I can use web_extract, or I can try pymupdf which works for text-based PDFs but not scanned documents or equations."
---
## pymupdf (lightweight)
```bash
pip install pymupdf pymupdf4llm
```
**Via helper script**:
```bash
python scripts/extract_pymupdf.py document.pdf # Plain text
python scripts/extract_pymupdf.py document.pdf --markdown # Markdown
python scripts/extract_pymupdf.py document.pdf --tables # Tables
python scripts/extract_pymupdf.py document.pdf --images out/ # Extract images
python scripts/extract_pymupdf.py document.pdf --metadata # Title, author, pages
python scripts/extract_pymupdf.py document.pdf --pages 0-4 # Specific pages
```
**Inline**:
```bash
python3 -c "
import pymupdf
doc = pymupdf.open('document.pdf')
for page in doc:
print(page.get_text())
"
```
---
## marker-pdf (high-quality OCR)
```bash
# Check disk space first
python scripts/extract_marker.py --check
pip install marker-pdf
```
**Via helper script**:
```bash
python scripts/extract_marker.py document.pdf # Markdown
python scripts/extract_marker.py document.pdf --json # JSON with metadata
python scripts/extract_marker.py document.pdf --output_dir out/ # Save images
python scripts/extract_marker.py scanned.pdf # Scanned PDF (OCR)
python scripts/extract_marker.py document.pdf --use_llm # LLM-boosted accuracy
```
**CLI** (installed with marker-pdf):
```bash
marker_single document.pdf --output_dir ./output
marker /path/to/folder --workers 4 # Batch
```
---
## Arxiv Papers
```
# Abstract only (fast)
web_extract(urls=["https://arxiv.org/abs/2402.03300"])
# Full paper
web_extract(urls=["https://arxiv.org/pdf/2402.03300"])
# Search
web_search(query="arxiv GRPO reinforcement learning 2026")
```
## Split, Merge & Search
pymupdf handles these natively — use `execute_code` or inline Python:
```python
# Split: extract pages 1-5 to a new PDF
import pymupdfFrom Martin-Hausleitner/martins-awesome-skills, MIT.
More from Martin-Hausleitner/martins-awesome-skills
- 0.524score
ai-research-output-publisher
Martin-Hausleitner
Use when turning finished AI research results into clear chat messages, copy-ready summaries, duration metrics, PSPin/deep-research links, and optional Notion…
SkillCFreshness: C★ 4Claude Code +9 - 0.519score
tool-comparison-heatmap
Martin-Hausleitner
Create interactive feature-comparison heatmaps that score, rank, and crown winners across multiple tools, repos, or products.
SkillCFreshness: C★ 4Claude Code +9 - 0.518score
github-issues
Martin-Hausleitner
Use when triaging, creating, labeling, searching, or closing GitHub issues
SkillCFreshness: C★ 4Claude Code +9 - 0.518score
github-auth
Martin-Hausleitner
Use when GitHub authentication is missing, broken, or needed before repository, issue, pull request, or CI work
SkillCFreshness: C★ 4Claude Code +9 - 0.518score
webhook-subscriptions
Martin-Hausleitner
Use when external services should trigger agent runs through webhook events
SkillCFreshness: C★ 4Claude Code +9 - 0.518score
github-pr-workflow
Martin-Hausleitner
Use when creating, updating, reviewing, testing, or merging a GitHub pull request
SkillCFreshness: C★ 4Claude Code +9 - 0.518score
notion
Martin-Hausleitner
Use when reading, creating, updating, or organizing Notion pages and databases through the Notion API
SkillCFreshness: C★ 4Claude Code +9
Signals
- Stars
- 4
- Forks
- 1
- Open issues
- 0
- Last commit (this folder)
- May 13, 2026 (5 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
More from Martin-Hausleitner
- 0.524score
ai-research-output-publisher
Martin-Hausleitner
Use when turning finished AI research results into clear chat messages, copy-ready summaries, duration metrics, PSPin/deep-research links, and optional Notion…
SkillCFreshness: C★ 4Claude Code +9 - 0.519score
tool-comparison-heatmap
Martin-Hausleitner
Create interactive feature-comparison heatmaps that score, rank, and crown winners across multiple tools, repos, or products.
SkillCFreshness: C★ 4Claude Code +9 - 0.518score
github-issues
Martin-Hausleitner
Use when triaging, creating, labeling, searching, or closing GitHub issues
SkillCFreshness: C★ 4Claude Code +9 - 0.518score
github-auth
Martin-Hausleitner
Use when GitHub authentication is missing, broken, or needed before repository, issue, pull request, or CI work
SkillCFreshness: C★ 4Claude Code +9 - 0.518score
webhook-subscriptions
Martin-Hausleitner
Use when external services should trigger agent runs through webhook events
SkillCFreshness: C★ 4Claude Code +9 - 0.518score
github-pr-workflow
Martin-Hausleitner
Use when creating, updating, reviewing, testing, or merging a GitHub pull request
SkillCFreshness: C★ 4Claude Code +9
Cite this page
ocr-and-documents skill. Agent Mart. https://agentmart.dev/skills/martin-hausleitner-ocr-and-documents (last updated 2026-10-24)