Skip to content

About

It's a very easy translation tool to use, we need to do nothing but download the project and double-click the .bat. But You still need a AI which can give you a API to use to work for you

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

PDF Translator

一键将学术论文 PDF 翻译为保留排版的 PDF。选择论文,自动翻译,直接输出。

本项目使用DeepSeek进行VibeCoding完成

功能

  • 选择 PDF — 选中文件,点击翻译,等待输出
  • AI 翻译 — 接入任意 OpenAI 兼容 API(DeepSeek / OpenAI / OpenRouter / Groq / 本地模型)
  • LaTeX 排版 — 翻译后的文本通过 LaTeX 重新排版,保留章节结构、公式、图表占位
  • 自动重试 — 编译失败时自动带着错误信息重调 AI,最多 3 次,超限则保留 .tex 源码
  • 即开即用 — 首次启动自动安装 Python 环境和依赖,无需用户手动配置
  • 未完成的功能 — 双语对照还没完成,暂时不可用

快速开始

方式一:一键启动(推荐)

1. 双击「启动翻译工具.bat」
2. 首次运行等待自动安装(约 1-3 分钟)
3. 在界面中输入你的 API Key
4. 选择 PDF → 点击翻译

方式二:命令行

# 首次初始化
python -m pdf_translator setup

# 直接翻译
python -m pdf_translator translate paper.pdf

# 启动界面
python -m pdf_translator

配置

在界面中可配置:

配置项 说明
API Key 你的 API 密钥
服务商 DeepSeek / OpenAI / OpenRouter / Groq / Together / 自定义
模型 自由输入模型名,如 deepseek-chat、gpt-4o、llama-3.3-70b-versatile
源语言 / 目标语言 中英日韩法德俄西等
输出目录 默认与输入 PDF 同目录

项目结构

Translation/
├── 启动翻译工具.bat          # 一键启动(双击)
├── _setup_wizard.py          # 安装向导(自动配置环境)
├── pdf_translator/           # 主程序
│   ├── __main__.py           # 入口
│   ├── gui/app.py            # Tkinter 图形界面
│   └── core/
│       ├── pdf_reader.py     # PDF 文本提取
│       ├── translator.py     # AI API 引擎
│       ├── latex_generator.py # LaTeX 生成 + 后处理
│       ├── latex_compiler.py # Tectonic 编译
│       └── pdf_writer.py     # 流水线编排 + 重试
├── resources/
│   └── templates/latex_preamble.tex  # LaTeX 模板
├── pyproject.toml
└── README.md

技术栈

模块 选型
GUI Tkinter
PDF 解析 PyMuPDF (fitz)
AI API OpenAI 兼容接口(任意服务商)
LaTeX 编译 Tectonic(自动下载,无需安装 TeX 发行版)
配置 TOML

许可证?

MIT?

About

It's a very easy translation tool to use, we need to do nothing but download the project and double-click the .bat. But You still need a AI which can give you a API to use to work for you

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages