pdfmathtranslate
Translates scientific PDFs while keeping formulas, figures and layout intact
pdf2zh translates scientific PDFs and writes a translated-only and a bilingual (dual) PDF, preserving formulas, charts, table of contents and annotations. It runs as a CLI, a Gradio web UI on port 7860, a Python or HTTP API, or an MCP server, and calls a configurable translation service (Google by default). Layout detection uses a DocLayout-YOLO ONNX model, with optional OCR and an --ultrafast mode.
Strengths
- Outputs both translated-only and side-by-side bilingual PDFs from one command
- Many interfaces: CLI, Gradio GUI, Docker, Python API, HTTP API, MCP stdio/SSE
- Selectable translation backends via -s, with Google as the default
- Optional OCR for scanned pages and --ultrafast mode for native-text PDFs
Weaknesses
- Python limited to 3.11 to 3.12
- OCR is experimental and targets white-background scans; handwriting may fail
- Last release is 2025-07-11; v2 work lives in a separate PDFMathTranslate-next repo
- --ultrafast is CLI fast mode only and is weaker on complex tables or formulas
- no GPU
- Docker + Compose
- Needs DocLayout-YOLO ONNX model (Hugging Face download), Translation service (Google default, others configurable)
- Models: ONNX
- port 7860