wshuyi/translate-pdf-skill

Translate PDF documents to any language while preserving layout and styling

3 stars0 forksUpdated Jan 1, 2026
npx skills add wshuyi/translate-pdf-skill

README

English | 中文

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:

  1. Extract all text from the PDF
  2. Translate to target language
  3. Replace text while preserving styling
  4. Output translated PDF

Supported Languages

LanguageFont
English, Spanish, Portuguese, French, German, etc.helv
Simplified Chinesechina-ss
Traditional Chinesechina-ts
Japanesejapan
Koreankorea

Example

Input: Portuguese organizational chart (Suprimentos.pdf)

Command: "把这个PDF翻译成中文"

Output: Chinese version with identical layout and styling

How It Works

  1. Extract: Parses PDF to get all text spans with positions, fonts, and colors
  2. Translate: Claude translates each text string
  3. Replace: Uses PDF redaction (transparent fill) to remove original text
  4. 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

@wshuyi


🤖 Generated with Claude Code

Publisher

wshuyiwshuyi

Statistics

Stars3
Forks0
Open Issues0
LicenseMIT License
CreatedJan 1, 2026