What does glm-ocr do?
AI-assisted GLM OCR toolkit for converting PDF, PPT, and images to Markdown.
Features
- Converts PDF, PPT, and image files to Markdown
- Preserves table structures and formatting
- Uses GLM AI for accurate text recognition
- Supports batch processing via CLI
Usage
glm-ocr input.pdf -o output.md
Requirements
- Python 3.8+
- GLM API key configured in environment variable
GLM_API_KEY
Installation
pip install glm-ocr
Configuration
Set your GLM API key:
export GLM_API_KEY='your-api-key-here'
Supported Platforms
- Linux
- macOS
- Windows (via WSL)
How It Works
The tool sends document pages to the GLM AI model for OCR processing. It then reconstructs the text and tables into Markdown format, preserving the original layout as much as possible.
Example
Convert a PDF file:
glm-ocr report.pdf -o report.md
Convert an image:
glm-ocr screenshot.png -o notes.md
License
MIT