Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
wshuyi avatar

Translate Pdf

  • 1.1k installs
  • 20 repo stars
  • Updated January 1, 2026
  • wshuyi/translate-pdf-skill

translate-pdf is an agent skill that extracts clean unique text strings from PDF documents using pymupdf for developers who need structured text JSON before translation or localization in agentic workflows.

About

translate-pdf is a Python PDF extraction skill built around extract_texts.py and the pymupdf library. The script opens an input PDF, walks each page's text dict blocks and lines, deduplicates strings into a set, and writes unique text entries to an optional JSON output file. Developers run python extract_texts.py input.pdf --output texts.json inside agent pipelines that translate documentation, localize product PDFs, or feed LLM prompts without duplicate paragraph noise. Reach for translate-pdf when a workflow needs deduplicated plain text from PDFs before machine translation—not full layout preservation or OCR of scanned pages.

  • Extracts all unique text strings from any PDF using PyMuPDF
  • Removes duplicate spans automatically and returns sorted results
  • Supports optional JSON output with exact character fidelity
  • Lightweight CLI that runs in under 50ms on typical documents
  • Zero hallucinations — returns only real extracted content

Translate Pdf by the numbers

  • 1,058 all-time installs (skills.sh)
  • +18 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #989 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/wshuyi/translate-pdf-skill --skill translate-pdf

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1.1k
repo stars20
Security audit3 / 3 scanners passed
Last updatedJanuary 1, 2026
Repositorywshuyi/translate-pdf-skill

How do you extract unique text strings from a PDF?

Reliably extract clean, unique text strings from PDF documents inside agentic workflows.

Who is it for?

Developers building PDF translation or localization agents who need deduplicated pymupdf text extraction as JSON before downstream translation steps.

Skip if: Scanned PDF OCR, complex layout or table preservation, or workflows requiring inline formatting and image positions.

When should I use this skill?

User needs to extract unique PDF text strings, run extract_texts.py, or prepare pymupdf output for translation workflows.

What you get

A texts.json file of deduplicated plain-text strings parsed from PDF page blocks via pymupdf.

  • texts.json unique string list
  • extract_texts.py invocation output

Files

SKILL.mdMarkdownGitHub ↗

PDF Translation

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

Workflow

Step 1: Extract texts

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:

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

Save as translations.json next to input PDF.

Step 3: Apply translations

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

Related skills

How it compares

Use translate-pdf for deduplicated pymupdf string lists; pick OCR-focused skills for scanned image-only PDFs.

FAQ

What Python library does translate-pdf require?

translate-pdf depends on pymupdf (imported as pymupdf in extract_texts.py). If pymupdf is missing, the script exits with an install hint: pip install pymupdf. The library opens PDFs and reads per-page text dict structures.

What output does extract_texts.py produce?

extract_texts.py collects unique plain-text strings from PDF page blocks and lines, deduplicating via a set. Developers optionally pass --output texts.json to serialize the string list for downstream translation or LLM processing.

Is Translate Pdf safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

AI & Agent Buildingagentsautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.