General Introduction
PDFMathTranslate is an AI-based tool specialized in translating PDF scientific papers while preserving the original formatting. It supports multiple languages and translation services such as Google, DeepL, Ollama, and OpenAI. Users can utilize the tool through command line tools, interactive interfaces, or Docker deployments.
Function List
- Complete retention of typography: The translated document retains its original layout, including formulas, charts, and table of contents.
- Multiple Translation Services: Supports multiple translation services such as Google, DeepL, Ollama and OpenAI.
- Multi-language support: Supports translations in multiple languages to meet different user needs.
- command-line tool: Provides easy-to-use command line tools for quick translations.
- interactive user interface (UI): Provides a friendly GUI interface for users who are not familiar with the command line.
- Docker Deployment: Supports Docker deployment for easy running in the cloud or on local servers.
- multithreaded translation: Support multi-threaded translation to improve translation efficiency.
- Regular expression configuration: Supports configuration of translation rules using regular expressions with high flexibility.
Using Help
Installation and Usage
PDFMathTranslate offers three ways to use it: command line tool, interactive interface and Docker deployment.
Method 1: Command line tool
- Make sure Python (versions 3.8 to 3.12) is installed.
- Install the PDFMathTranslate package:
pip install pdf2zh
- Use the command line tool to translate the documentation:
pdf2zh document.pdf
Method 2: Interactive Interface
- Make sure Python (versions 3.8 to 3.12) is installed.
- Install the PDFMathTranslate package:
pip install pdf2zh
- Launch the interactive interface in your browser:
pdf2zh -i
If your browser does not start automatically, please open it manually http://localhost:7860/
Method 3: Docker Deployment
- Pull and run the Docker image:
docker pull byaidu/pdf2zh docker run -p 7860:7860 byaidu/pdf2zh
- Open http://localhost:7860/ in your browser
Advanced Options
- Go to the Interaction screen:
pdf2zh -i
- Partial translation of the documentation:
pdf2zh example.pdf -p 1
- Specify the source and target languages:
pdf2zh example.pdf -li en -lo zh
- Select a translation service:
pdf2zh example.pdf -s deepl
- Multi-threaded translation:
pdf2zh example.pdf -t 1
- Use regular expressions to specify formula fonts and characters to be preserved:
pdf2zh example.pdf -f "(MS.*)"