wshuyi/translate-pdf-skill
Translate PDF documents to any language while preserving layout and styling
npx skills add wshuyi/translate-pdf-skillREADME
Translate PDF Skill
Translate PDF documents to any language while preserving the original structure, layout, colors, and styling.
The Problem
Translating PDF documents is typically painful:
- Copy-paste loses all formatting
- Online tools mangle the layout
- Professional translation services are expensive and slow
- Technical diagrams and org charts are especially difficult
The Solution
This Claude Code skill translates PDF text in place, preserving:
- ✅ Original layout and positions
- ✅ Background colors (yellow boxes, blue headers, etc.)
- ✅ Font sizes and text colors
- ✅ Document structure
Translation time: ~1 minute vs hours of manual work.
Requirements
- Python 3.8+
- pymupdf (
pip install pymupdf) - Claude Code CLI
Installation
Method 1: Git Clone
git clone https://github.com/wshuyi/translate-pdf-skill.git
cp -r translate-pdf-skill/skills/translate-pdf ~/.claude/skills/
Method 2: Plugin Marketplace
/plugin install translate-pdf@wshuyi/translate-pdf-skill
Usage
Simply tell Claude what you want:
"Translate this PDF to Chinese"
"把这个PDF翻译成英文"
"Translate report.pdf to Japanese"
Claude will:
- Extract all text from the PDF
- Translate to target language
- Replace text while preserving styling
- Output translated PDF
Supported Languages
| Language | Font |
|---|---|
| English, Spanish, Portuguese, French, German, etc. | helv |
| Simplified Chinese | china-ss |
| Traditional Chinese | china-ts |
| Japanese | japan |
| Korean | korea |
Example
Input: Portuguese organizational chart (Suprimentos.pdf)
Command: "把这个PDF翻译成中文"
Output: Chinese version with identical layout and styling
How It Works
- Extract: Parses PDF to get all text spans with positions, fonts, and colors
- Translate: Claude translates each text string
- Replace: Uses PDF redaction (transparent fill) to remove original text
- Insert: Adds translated text at same positions with matching style
FAQ
Q: Does it work with scanned PDFs? A: No, this skill works with text-based PDFs. Scanned documents need OCR first.
Q: Will it change my PDF layout? A: No, the layout is preserved. Only the text content changes.
Q: What about images and charts? A: Images are preserved. Text within the PDF is translated.
License
MIT License - see LICENSE
Author
🤖 Generated with Claude Code