PDFMathTranslate
$ pdf2zh Community Med RiskPDFMathTranslate (pdf2zh) parses academic and technical PDFs to produce bilingual and monolingual translations while preserving multi-column layout, vector formulas, and tables. Supports Google, DeepL, OpenAI, and local Ollama backends via CLI, GUI (-i), Docker, and MCP.
pip install pdf2zh Batch-translating PDFs via headless pdf2zh CLI flags (-p, -li, -lo, -s, -o) is cleaner than driving translation through MCP tool calls.
At a Glance
- Command
- $ pdf2zh
- FCRS-1.0 Score
- 76/100 (Good)
- Evidence Tier
- Medium Confidence
- CLI vs MCP
- CLI Preferred vs MCP
- Reviewed Date
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports deterministic headless flags (-p, -li, -lo, -s, -t, -o) without prompts, though lacks a native --json summary flag.
- Non-interactive CLI flags (
-p,-li,-lo,-s,-o), no native--jsonoutput
Writes bilingual/monolingual PDFs locally, though external -s translation backends transmit document text over the network.
- Local PDF output; external MT/LLM backends send document text off-machine
Installable via pip install pdf2zh or Docker, though initial runs fetch layout-detection models and font assets.
- PyPI (
pdf2zh) and Docker images; downloads model/font dependencies
Best-in-class preservation of LaTeX math, multi-column layouts, and figures in academic PDFs.
- Layout- and formula-preserving bilingual PDF rendering
EMNLP 2025 demo and widely adopted OSS project (PDFMathTranslate/PDFMathTranslate, 38.9k+ stars) under AGPL-3.0.
PDFMathTranslate/PDFMathTranslaterepository
Well-documented CLI options, service configs, and Zotero/Docker workflows in README and pdf2zh.com.
- Docs at pdf2zh.com and GitHub README
Security, Auth & Guardrails
Reads translation service API keys (OPENAI_API_KEY, DEEPL_AUTH_KEY, etc.) from environment variables or local config; supports local Ollama with no cloud keys.
AGPL-3.0 open-source CLI; translation costs depend on whether you pick free/local Ollama or paid LLM/DeepL APIs.
# pdf2zh Agent Rules - Never pass `-i` (GUI mode) in headless agent shells. - Scope large papers first with `-p 1-3` and explicit `-o <dir>` output directories. - Do not send confidential PDFs to external translation backends (`-s google|openai`) without approval; prefer local Ollama when sensitive.
Agent-Ready Command Recipes
Safe Read-Only Queries
pdf2zh --help
Displays language codes, backend service options (-s), page filters (-p), and output flags.
Controlled Writes & Previews
pdf2zh -p 1-3 -li en -lo zh -s openai -t 4 -o ./out paper.pdf
Translates pages 1–3 from English to Chinese using 4 threads while preserving formulas and writing to ./out.
Strengths for Agents
- + Preserves complex LaTeX equations, figures, and academic multi-column layouts.
- + Flexible backend selection (
-s) spanning OpenAI, DeepL, Google, and offline Ollama. - + Partial-page translation (
-p) and multi-threading (-t) speed up iterative testing.
Caveats & Pitfalls
- ! Lacks a native
--jsonrun summary output; agents must inspect exit code and-ooutput files. - ! First run downloads layout-analysis weights and may require
--skip-subset-fontson tricky PDFs. - ! AGPL-3.0 license requires copyleft compliance if offered as a modified network service.