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.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ac-document-gen:pdf-ocrThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
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.
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-pagenpx claudepluginhub alteredcraft/claude-code-plugins --plugin ac-document-genConvert PDF files to LLM-ready markdown, DocTags, or JSON using Docling. Handles analysis, summarization, OCR, and batch processing with token savings estimates.
Converts PDFs to structured Markdown preserving headings, tables, lists, reading order. Use for text extraction, batch processing, RAG ingestion, LLM context, or PDF analysis tasks.
Extracts text and structured data from single or batch PDFs using 9 backends with automatic fallback, OCR for scanned docs, and markdown output via CLI.