Translate Pdf

wshuyi/translate-pdf-skill/skills/translate-pdf

作者 wshuyi5836f0de12d9bd173187f01dfd9efaf992fcaae2無授權條款收錄於 2026年10月9日更新於 2026年10月9日

Translate PDF documents to any language while preserving original structure, layout, and styling (colors, backgrounds, positions). Use when user wants to: (1) translate a PDF to another language, (2) convert PDF from one language to another, (3) create translated version of PDF document. Triggers: "translate PDF", "PDF翻译", "把PDF翻译成", "translate this PDF to Chinese/English/Japanese", "翻译成中文/英文"

AI 產生的概覽

將 PDF 文件翻譯成其他語言,同時保留原有版面、顏色與背景樣式。

功能
此技能會先擷取 PDF 中所有不重複的文字,由代理產生原文對譯文的 JSON 對應表,再把譯文套回 PDF。它附帶兩個 Python 指令碼:一個用於擷取文字,一個用於依指定字型套用翻譯。最後產出保留原有結構與樣式的新 PDF。
適用情境
當使用者需要把 PDF 翻譯成另一種語言、從一種語言轉換成另一種語言,或產生原文件翻譯版本時使用。適合「把 PDF 翻譯成中文/英文/日文」等需求。
執行需求
需要 Python 執行環境來執行隨附的兩個指令碼,以及 PDF 輸入檔案和翻譯 JSON 檔案。字型須依目標語言選擇(拉丁、簡體中文、繁體中文、日文或韓文)。

PDF Translation

Translate PDF text while preserving structure, colors, and background styling.

Workflow

Step 1: Extract texts

bash
python {skill_path}/scripts/extract_texts.py <input.pdf>

Review output to see all unique text strings in the PDF.

Step 2: Create translation mapping

Translate each text to target language. Create JSON file:

json
{  "Original Text 1": "Translated 1",  "Original Text 2": "Translated 2"}

Save as translations.json next to input PDF.

Step 3: Apply translations

bash
python {skill_path}/scripts/translate_pdf.py <input.pdf> translations.json <output.pdf> --font <fontname>

Font options:

FontLanguage
helvLatin (English, Spanish, Portuguese, French, German, etc.)
china-ssSimplified Chinese
china-tsTraditional Chinese
japanJapanese
koreaKorean

Output naming

Append language suffix: filename_EN.pdf, filename_ZH.pdf, filename_JA.pdf

Tips

  • Keep proper nouns, abbreviations, technical terms unchanged when appropriate
  • CJK fonts auto-scale to 90% for better fit
  • Use transparent fill to preserve original background colors

來源與署名

來源:wshuyi/translate-pdf-skill位於skills/translate-pdf提交5836f0d

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架