General Introduction
PDFMathTranslate is an open source tool that focuses on translating scientific papers, and is able to translate PDF documents in their entirety and generate bilingual versions. It uses AI technology to retain the full layout of the original document , including formulas , charts , tables of contents and notes , support Google, DeepL, Ollama, OpenAI and other translation services. The tool offers command line (CLI), graphical interface (GUI), Docker deployment, and Zotero plugin to meet the needs of researchers for rapid translation and reading. As of March 2025, the project has received over 17,000 stars on GitHub, has an active community, and continues to be updated with new support for native models, non-PDF/A files, and BabelDOC backends.
-
Online experience: https://pdf2zh.com/
Function List
- Full translation and bilingualism: Translate PDF documents into the target language, generating both monolingual translations and bilingual cross-references.
- Retain original typography: Ensure consistent formatting of formulas, charts, tables of contents, and notes, and support for complex typesetting such as LaTeX.
- Multi-language support: Translation from multiple source languages such as English to multiple target languages such as Chinese.
- Multi-Translation Services: Integration with services such as Google, DeepL, OpenAI, Ollama, and support for Xinference Local models.
- Multi-platform use: Provides CLI tools, GUI interface, Docker containers and Zotero plugins.
- Online Experience:: Try out core functionality without installation through public services.
- Advanced Customization: Support for advanced options such as partial translation, multi-threaded processing, and customized output directories.
Using Help
Installation process
PDFMathTranslate provides multiple installation methods for different scenarios. Below are the detailed steps:
1. UV installation (command line recommended)
- prerequisitesPython 3.10 to 3.12 should be installed on your system.
- move:
- Install the UV tool:
pip install uv
- Install PDFMathTranslate:
uv tool install --python 3.12 pdf2zh
- Verify: Run
pdf2zh --version
If the version number is displayed, it is successful.
- Install the UV tool:
- Network troubleshooting: If the model cannot be downloaded
wybxc/DocLayout-YOLO-DocStructBench-onnx
, set the environment variables:- CMD.
set HF_ENDPOINT=https://hf-mirror.com
- PowerShell.
$env:HF_ENDPOINT = "https://hf-mirror.com"
- CMD.
2. Windows executable (no programming environment required)
- move:
- Visit the GitHub release page (https://github.com/Byaidu/PDFMathTranslate/releases).
- Download the latest
pdf2zh-version-win64.zip
The - Unzip and double-click
pdf2zh.exe
Running.
- take note of: If it does not work, you need to install the VC++ runtime library (https://aka.ms/vs/17/release/vc_redist.x64.exe).
3. Graphical user interface (GUI)
- prerequisites: Python 3.10 to 3.12.
- move:
- Install the package:
pip install pdf2zh
- Start the GUI:
pdf2zh -i
- browser access
http://localhost:7860/
(If not turned on automatically, enter manually).
- Install the package:
- Network troubleshooting: Same as UV mounting method.
4. Docker deployment
- prerequisites: Docker is installed (https://www.docker.com/).
- move:
- Pull the image and run it:
docker pull byaidu/pdf2zh docker run -d -p 7860:7860 byaidu/pdf2zh
- browser access
http://localhost:7860/
The
- Pull the image and run it:
- Alternative Programs: If Docker Hub is not available, use GitHub mirrors:
docker pull ghcr.io/byaidu/pdfmathtranslate
docker run -d -p 7860:7860 ghcr.io/byaidu/pdfmathtranslate
5. Zotero plug-in
- move:
- Visit https://github.com/guaguastandup/zotero-pdf2zh to download the plugin.
- Install and configure translation parameters in Zotero.
workflow
1. Command-line translation
- basic operation:
- Prepare PDF files (e.g.
paper.pdf
). - Run command:
pdf2zh paper.pdf
- Output: Generate
paper-mono.pdf
(translation) andpaper-dual.pdf
(bilingual), save to current directory.
- Advanced Options:
- Specify the language:
-li en -lo zh
(English to Chinese). - Select Service:
-s deepl
(Use DeepL). - Partial translation:
-p 1-5
(pages 1-5). - Output Path:
-o . /output
The
Example:
pdf2zh paper.pdf -li en -lo zh -s openai -o . /translated
- compatibility:: Non-PDF/A files plus
--compatible
Parameters:
pdf2zh paper.pdf --compatible
2. Use of the GUI interface
- procedure:
- Start the GUI (
pdf2zh -i
). - Upload a file: Click "Select File" to upload a local PDF, or enter an online link (e.g., "Upload PDF").
http://arxiv.org/paper.pdf
). - Configuration parameters:
- Source Language: Select "English".
- Target language: Select "Chinese (Simplified)".
- Translation service: choose "Google" or other.
- Click "Translate" and wait for it to finish.
- Download: Get a monolingual or bilingual PDF file.
- Featured Functions: Support for online link translation and intuitive operation.
3. Docker Online Services
- procedure:
- Run the container and then access the
http://localhost:7860/
The - Same as GUI operation, upload files or links, set parameters and then translate.
- Share function: add
--share
parameter to generate a public link:pdf2zh --i --share
4. Zotero plug-in usage
- procedure:
- Select the PDF document in Zotero.
- Click on the plugin icon to set the language and services.
- The result is automatically appended to the entry after translation.
Featured Functions
- Preserve typography: Use
DocLayout-YOLO
Model parsing layout to ensure accurate placement of formulas and charts. - Online Service Experience: Visit https://pdf2zh.com/ or https://app.immersivetranslate.com/babel-doc/ (1,000 free pages per month) to use without installation.
- Multi-threaded acceleration: Use
-t 4
Enable 4 threads for large files:
pdf2zh large_paper.pdf -t 4
caveat
- Resource constraints: The online demo has limited computing resources, so please do not abuse them.
- Update Log: March 2025 Added BabelDOC WebUI support (experimental) to enhance the translation experience.
- Community Feedback: Submit suggestions via GitHub Issues (https://github.com/Byaidu/PDFMathTranslate/issues) or the Telegram group (https://t.me/+Z9_SgnxmsmA5NzBl).
PDFMathTranslate Unofficial Integration Package
https://pan.quark.cn/s/e9e912c62c3a#/list/share
https://github.com/aidayang/PDFMathTranslate-OneClick