From ac-document-gen
Converts PDF files to markdown using local GLM-OCR via Ollama. Renders each page to image, runs OCR, assembles clean text output. Use for extracting text from PDFs.
npx claudepluginhub alteredcraft/claude-code-plugins --plugin ac-document-genThis skill is limited to using the following tools:
Convert PDF files to markdown using local OCR. Each page is rendered to an image, processed through GLM-OCR running on Ollama, and the recognized text is assembled into a single markdown file.
Converts PDF files to Markdown using opendataloader-pdf, extracting text, tables, headings, lists, and images in correct reading order. For PDF parsing, document extraction, and AI/LLM/RAG data preparation.
Extracts text from images and PDFs using Mistral OCR API via curl. Converts scanned documents to Markdown, JSON, or plain text without external dependencies. Use for OCR and digitization tasks.
Provides Python API for OCRmyPDF to add searchable text layers to PDFs programmatically, supporting deskew, optimization, page selection, and plugins like EasyOCR, PaddleOCR. Use for OCR pipelines in Python apps.
Share bugs, ideas, or general feedback.
Convert PDF files to markdown using local OCR. Each page is rendered to an image, processed through GLM-OCR running on Ollama, and the recognized text is assembled into a single markdown file.
Run these checks and report a status table. If any required dependency is missing, use AskUserQuestion to offer installation.
| Dependency | Check | Install |
|---|---|---|
| Ollama running | curl -sf http://127.0.0.1:11434/api/tags > /dev/null | Cannot auto-start. Tell user to start Ollama and stop. |
glm-ocr model | Check that Ollama tags response contains glm-ocr | ollama pull glm-ocr |
pdftoppm | which pdftoppm | brew install poppler |
pdfinfo | which pdfinfo | Comes with poppler |
sips | which sips | Built-in on macOS. Warn if missing. |
Check all five in a single Bash call:
echo "=== Ollama ===" && curl -sf http://127.0.0.1:11434/api/tags && echo "" && echo "=== pdftoppm ===" && which pdftoppm && echo "=== pdfinfo ===" && which pdfinfo && echo "=== sips ===" && which sips
Parse the output:
glm-ocr is not in the tags list: ask user if they want to pull it (ollama pull glm-ocr).pdftoppm or pdfinfo missing: ask user if they want to install poppler (brew install poppler).sips missing: warn user (built-in on macOS, no auto-install).If all checks pass, proceed to Phase 2.
Validate the argument is a path to an existing .pdf file. If no argument was provided, print usage and stop:
Usage:
/pdf-ocr <path-to-pdf>Converts a PDF to markdown using local GLM-OCR via Ollama.
Determine the output path: same directory as the PDF, same base name with .md extension.
Get the page count to decide foreground vs background execution:
pdfinfo "<pdf_path>" | grep "^Pages:"
python3 ${CLAUDE_PLUGIN_ROOT}/skills/pdf-ocr/scripts/pdf_ocr.py "<input.pdf>" "<output.md>"
timeout: 600000.After the script completes:
.md file to show a preview."Text Recognition:" — other prompts degrade quality<!-- Page N --> marker with --- separators between pages/tmp/claude/ocr_pages and cleaned up per-page