Agent skill

translate-pdf

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", "翻译成中文/英文"

Stars 7
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/wshuyi/translate-pdf-skill/tree/main/skills/translate-pdf

SKILL.md

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:

Font Language
helv Latin (English, Spanish, Portuguese, French, German, etc.)
china-ss Simplified Chinese
china-ts Traditional Chinese
japan Japanese
korea Korean

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

Expand your agent's capabilities with these related and highly-rated skills.

wshuyi/x-article-publisher-skill

x-article-publisher

Publish Markdown articles to X (Twitter) Articles editor with proper formatting. Use when user wants to publish a Markdown file/URL to X Articles, or mentions "publish to X", "post article to Twitter", "X article", or wants help with X Premium article publishing. Handles cover image upload and converts Markdown to rich text automatically.

697 71
Explore
mattpocock/skills

edit-article

Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.

111,310 9,758
Explore
mattpocock/skills

git-guardrails-claude-code

Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.

111,310 9,758
Explore
mattpocock/skills

setup-pre-commit

Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.

111,310 9,758
Explore
mattpocock/skills

obsidian-vault

Search, create, and manage notes in the Obsidian vault with wikilinks and index notes. Use when user wants to find, create, or organize notes in Obsidian.

111,310 9,758
Explore
mattpocock/skills

handoff

Compact the current conversation into a handoff document for another agent to pick up.

111,310 9,758
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results