pdf-translate
Use when translating PDF documents between languages while preserving original layout, images, tables, and formulas using pdf2zh (PDFMathTranslate).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when translating PDF documents between languages while preserving original layout, images, tables, and formulas using pdf2zh (PDFMathTranslate).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | pdf-translate |
| description | Use when translating PDF documents between languages while preserving original layout, images, tables, and formulas using pdf2zh (PDFMathTranslate). |
| version | 1.0.0 |
| author | Yi |
| license | MIT |
| platforms | ["linux","macos","windows"] |
| metadata | {"hermes":{"tags":["PDF","Translation","Documents","Multi-language","Google-Translate"],"related_skills":["ocr-and-documents"]}} |
Translate PDF documents between languages while fully preserving original layout, images, tables, formulas, and typography. Uses pdf2zh (PDFMathTranslate, accepted at EMNLP 2025) with Google Translate as the free default backend.
Output: two files — *-mono.pdf (translated only) and *-dual.pdf (bilingual side-by-side).
Don't use for: simple text extraction without layout preservation (use ocr-and-documents skill instead).
# Install pdf2zh
pip install pdf2zh
No API key needed for Google Translate backend (free, no sign-up).
# Translate Chinese to English
pdf2zh input.pdf -li zh -lo en -s google
# Translate English to Chinese
pdf2zh input.pdf -li en -lo zh -s google
# Translate Japanese to English
pdf2zh input.pdf -li ja -lo en -s google
# Translate French to Chinese
pdf2zh input.pdf -li fr -lo zh -s google
This generates:
input-mono.pdf — translated-only versioninput-dual.pdf — bilingual version (original left, translated right)pdf2zh input.pdf -li zh -lo en -s google -o ./output/
pdf2zh input.pdf -li zh -lo en -s google -p 1-10
pdf2zh https://example.com/document.pdf -li zh -lo en -s google
pdf2zh --dir ./pdfs/ -li zh -lo en -s google
pdf2zh -i
# Opens at http://localhost:7860
| Backend | Command | API Key Needed |
|---|---|---|
| Google (free) | -s google | No |
| DeepL | -s deepl | Yes (higher quality) |
| OpenAI | -s openai | Yes |
| Ollama (local) | -s ollama | No (local LLM) |
| Azure | -s azure | Yes |
| Claude | -s claude | Yes |
| Language | Code |
|---|---|
| Chinese (Simplified) | zh |
| Chinese (Traditional) | zh-TW |
| English | en |
| Japanese | ja |
| Korean | ko |
| French | fr |
| German | de |
| Spanish | es |
| Russian | ru |
| Arabic | ar |
| Portuguese | pt |
| Italian | it |
| Flag | Description | Example |
|---|---|---|
-li | Source language | -li zh |
-lo | Target language | -lo en |
-s | Translation service | -s google |
-p | Specific pages | -p 1,3,5-10 |
-o | Output directory | -o ./output/ |
-t | Thread count | -t 4 |
-f | Exclude text (regex) | -f "(MS.*)" |
--dir | Batch translate folder | --dir ./pdfs/ |
-i | Launch GUI | -i |
--compatible | Compatibility mode | --compatible |
--ignore-cache | Bypass translation cache | --ignore-cache |
pip install -q pdf2zh && pdf2zh input.pdf -li zh -lo en -s google
pdf2zh input.pdf -li zh -lo en -s openai
# Requires OPENAI_API_KEY in environment
Model download failure: pdf2zh downloads a layout detection model (wybxc/DocLayout-YOLO-DocStructBench-onnx) on first run. If blocked by network, set:
export HF_ENDPOINT=https://hf-mirror.com
Large PDF processing: For documents with 100+ pages, increase thread count:
pdf2zh input.pdf -li zh -lo en -s google -t 4
Translation rate limits: Very large documents may hit the translation service's rate limit. Try splitting the document:
pdf2zh input.pdf -li zh -lo en -s google -p 1-20
pdf2zh input.pdf -li zh -lo en -s google -p 21-40
Compatibility issues: If the output has rendering problems, try compatibility mode:
pdf2zh input.pdf -li zh -lo en -s google --compatible
*-mono.pdf exists and contains translated text*-dual.pdf exists with bilingual layout