type
status
date
summary
tags
category
slug
icon
password
公众号
关键词
小宇宙播客
小红书
数字人视频号
笔记
Bilingual translation of complete PDF documents with preserved formatting, supporting Google, DeepL, Ollama, and OpenAI translation
Github repository: https://github.com/Byaidu/PDFMathTranslate


- • PDF document translation with bilingual comparison
- • 📊 Preserve formulas and charts
- • 📄 Preserve searchable table of contents
- • 🌐 Support multiple translation services
Requires Python version >=3.8, <=3.12
Execute translation command in the command line to generate translated document example-zh.pdf and bilingual comparison document example-dual.pdf in the working directory, using Google as the default translation service
Refer to Google Languages Codes, DeepL Languages Codes
Refer to DeepLX
Environment variable build endpoint: {DEEPL_SERVER_URL}/{DEEPL_AUTH_KEY}/translate
- • DEEPL_SERVER_URL (Optional), e.g., export DEEPL_SERVER_URL=https://api.deepl.com
- •
DEEPL_AUTH_KEY, e.g.,export DEEPL_AUTH_KEY=xxx
Reference Ollama
Set environment variable build endpoint: {OLLAMA_HOST}/api/chat
- • OLLAMA_HOST (Optional), e.g., export OLLAMA_HOST=https://localhost:11434
Reference SiliconCloud, Zhipu
Set environment variable build endpoint: {OPENAI_BASE_URL}/chat/completions
- • OPENAI_BASE_URL (Optional), e.g., export OPENAI_BASE_URL=https://api.openai.com/v1
- •
OPENAI_API_KEY, e.g.,export OPENAI_API_KEY=xxx
上一篇
Why I Gave Up GitHub Copilot and Switched to Cursor
下一篇
Create a Viral App in 60 Minutes! How to Do It?
- 作者:Dr. Charlii
- 链接:https://www.charliiai.com/article/PDFMathTranslate
- 声明:本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。










