docker pull ghcr.io/byaidu/pdfmathtranslate
docker run -d -p 7860:7860 ghcr.io/byaidu/pdfmathtranslate
3.2.* Solutions for network issues in installation
Users in specific regions may encounter network difficulties when loading the AI model. The current program relies on the AI model (wybxc/DocLayout-YOLO-DocStructBench-onnx), and some users are unable to download it due to these network issues.
To address issues with downloading this model, use the following environment variable as a workaround:
set HF_ENDPOINT=https://hf-mirror.com
For PowerShell user:
$env:HF_ENDPOINT = https://hf-mirror.com
If the solution does not work to you / you encountered other issues, please refer to Frequently Asked Questions.
4. Technical Details
4.1 Advanced options
Execute the translation command in the command line to generate the translated document example-mono.pdf and the bilingual document example-dual.pdf in the current working directory. Use Google as the default translation service. More support translation services can find HERE.
In the following table, we list all advanced options for reference:
For detailed explanations, please refer to our document about Advanced Usage for a full list of each option.
4.2 Downstream Development
For downstream applications, please refer to our document about [API Details](/mirrors/PDFMathTranslate/tree/main/docs/APIS.md) for further information about:
Python API, how to use the program in other Python programs
HTTP API, how to communicate with a server with the program installed
PDFMathTranslate/PDFMathTranslate-next: A fork with web-ui and additional features. This fork handles a large number of marginal cases, improves PDF compatibility, and optimizes cross-column and cross-page semantic consistency, dynamic scaling, and dynamic scaling consistency, among many other translation quality improvements. However, this fork is intended solely for development and does not address compatibility issues and is not designed for community-contributions.
@inproceedings{ouyang-etal-2025-pdfmathtranslate,
title = "{PDFM}ath{T}ranslate: Scientific Document Translation Preserving Layouts",
author = "Ouyang, Rongxin and
Chu, Chang and
Xin, Zhikuang and
Ma, Xiangyao",
editor = {Habernal, Ivan and
Schulam, Peter and
Tiedemann, J{\"o}rg},
booktitle = "Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing: System Demonstrations",
month = nov,
year = "2025",
address = "Suzhou, China",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2025.emnlp-demos.71/",
pages = "918--924",
ISBN = "979-8-89176-334-0",
abstract = "Language barriers in scientific documents hinder the diffusion and development of science and technologies. However, prior efforts in translating such documents largely overlooked the information in layouts. To bridge the gap, we introduce PDFMathTranslate, the world{'}s first open-source software for translating scientific documents while preserving layouts. Leveraging the most recent advances in large language models and precise layout detection, we contribute to the community with key improvements in precision, flexibility, and efficiency. The work is open-sourced at https://github.com/byaidu/pdfmathtranslate with more than 222k downloads."
}
Warp, built for coding with multiple AI agents
Available for macOS, Linux and Windows
English | 简体中文 | 繁體中文 | 日本語 | 한국어
PDFMathTranslate
1. What does this do?
Scientific PDF document translation preserving layouts.
2. Recent Updates
[May 9, 2025] pdf2zh 2.0 Preview Version #586: The Windows ZIP file and Docker image are now available.
[Mar. 3, 2025] Experimental support for the new backend BabelDOC WebUI added as an experimental option (by @awwaawwa)
[Feb. 22 2025] Better release CI and well-packaged windows-amd64 exe (by @awwaawwa)
3. Use 🌟
3.1 Online Service 🌟
You can try our application out using either of the following demos:
Note that the computing resources of the demo are limited, so please avoid abusing them.
3.2 Local Installation
For different use cases, we provide distinct methods to use our program:
3.2.1 Python: Install using uv
Python installed (3.10 <= version <= 3.12)
Install our package:
Execute translation, files generated in current working directory:
3.2.2 Python: Install using pip
Python installed (3.10 <= version <= 3.12)
Install our package:
Execute translation, files generated in current working directory:
3.3.3 Python: Graphic user interface
Python installed (3.10 <= version <= 3.12)
Install our package:
Start using in browser:
If your browser has not been started automatically, goto
See documentation for GUI for more details.
3.2.4 Application: On Windows
Download pdf2zh-version-win64.zip from release page
Unzip and double-click
pdf2zh.exeto run.3.2.5 Reference manager: Zotero Plugin
See Zotero PDF2zh for more details.
3.2.6 Docker: Containerized Deployment
Pull and run:
Open in browser:
For docker deployment on cloud service:
3.2.* Solutions for network issues in installation
Users in specific regions may encounter network difficulties when loading the AI model. The current program relies on the AI model (
wybxc/DocLayout-YOLO-DocStructBench-onnx), and some users are unable to download it due to these network issues.To address issues with downloading this model, use the following environment variable as a workaround:
For PowerShell user:
If the solution does not work to you / you encountered other issues, please refer to Frequently Asked Questions.
4. Technical Details
4.1 Advanced options
Execute the translation command in the command line to generate the translated document
example-mono.pdfand the bilingual documentexample-dual.pdfin the current working directory. Use Google as the default translation service. More support translation services can find HERE.In the following table, we list all advanced options for reference:
pdf2zh ~/local.pdfpdf2zh http://arxiv.org/paper.pdf-ipdf2zh -i-ppdf2zh example.pdf -p 1-lipdf2zh example.pdf -li en-lopdf2zh example.pdf -lo zh-spdf2zh example.pdf -s deepl-tpdf2zh example.pdf -t 1-opdf2zh example.pdf -o output-f,-cpdf2zh example.pdf -f "(MS.*)"-cppdf2zh example.pdf --compatible--skip-subset-fontspdf2zh example.pdf --skip-subset-fonts--ignore-cachepdf2zh example.pdf --ignore-cache--sharepdf2zh -i --share--authorizedpdf2zh -i --authorized users.txt [auth.html]--promptpdf2zh --prompt [prompt.txt]--onnxpdf2zh --onnx [onnx/model/path]--serverportpdf2zh --serverport 7860--dirpdf2zh --dir /path/to/translate/--configpdf2zh --config /path/to/config/config.json--serverportpdf2zh --serverport 7860--babeldocpdf2zh --babeldoc-s openai example.pdf--mcppdf2zh --mcp--ssepdf2zh --mcp --sseFor detailed explanations, please refer to our document about Advanced Usage for a full list of each option.
4.2 Downstream Development
For downstream applications, please refer to our document about [API Details](/mirrors/PDFMathTranslate/tree/main/docs/APIS.md) for further information about:4.3 Differences between two major forks
Byaidu/PDFMathTranslate: The present and the original project for stable release.
PDFMathTranslate/PDFMathTranslate-next: A fork with web-ui and additional features. This fork handles a large number of marginal cases, improves PDF compatibility, and optimizes cross-column and cross-page semantic consistency, dynamic scaling, and dynamic scaling consistency, among many other translation quality improvements. However, this fork is intended solely for development and does not address compatibility issues and is not designed for community-contributions.
5. Project Information
5.1 Citation
This work has been accepted by the Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing: System Demonstrations (EMNLP 2025).
Citation:
5.2 Acknowledgement
Immersive Translation sponsors monthly Pro membership redemption codes for active contributors to this project, see details at: CONTRIBUTOR_REWARD.md
New backend: BabelDOC
Document merging: PyMuPDF
Document parsing: Pdfminer.six
Document extraction: MinerU
Document Preview: Gradio PDF
Multi-threaded translation: MathTranslate
Layout parsing: DocLayout-YOLO
Document standard: PDF Explained, PDF Cheat Sheets
Multilingual Font: Go Noto Universal
5.3 Contributors
For details on how to contribute, please consult the Contribution Guide.
5.4 Star History