2.0 KiB
name, description, version, author, license, metadata
| name | description | version | author | license | metadata | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| document-tools | Document processing: PDF editing (nano-pdf) and text extraction from PDFs/scans (pymupdf, marker-pdf). | 1.0.0 | Hermes Agent | MIT |
|
Document Tools
Two document processing workflows: in-place PDF editing and text extraction from PDFs/scans.
Section 1: nano-pdf — In-Place PDF Editing
Edit PDF text, fix typos, and update titles using the nano-pdf CLI with natural language prompts.
When to use: Fixing typos in PDFs, updating document titles, changing specific text in PDFs without regenerating.
Installation:
npm install -g nano-pdf
Usage:
# Fix a typo
nano-pdf document.pdf "change 'teh' to 'the'"
# Update title
nano-pdf document.pdf "set title to 'Annual Report 2025'"
See: references/nano-pdf.md for full CLI reference.
Section 2: OCR & Document Text Extraction
Extract text from PDFs and scanned documents using pymupdf (fast native extraction) or marker-pdf (OCR + layout analysis).
When to use: Reading PDF content, extracting text from scans, converting PDFs to plain text or markdown.
pymupdf (Fast, Native PDF)
import pymupdf # fitz
doc = pymupdf.open("document.pdf")
for page in doc:
text = page.get_text()
print(text)
Best for: Text-based PDFs, fast extraction, page-level access, image/MRI extraction.
marker-pdf (OCR + Layout)
pip install marker-pdf
marker_single document.pdf output_dir
Best for: Scanned documents, OCR-needed PDFs, preserving layout, converting to markdown.
Choosing
| Need | Tool |
|---|---|
| Fast text extraction from text PDF | pymupdf |
| Scanned/image PDFs | marker-pdf |
| Need markdown output | marker-pdf |
| Extract images from PDF | pymupdf |
| Preserve document layout | marker-pdf |
See: references/ocr-and-documents.md for full API reference and troubleshooting.