Agent skill

PDF Translate

by breslee1707 in breslee1707/VI-Translate

Translate local PDFs, including safe prose on image-only scans, into Vietnamese or another supported Latin-script language while preserving layout, formulas, tables, and figures.

AGPL-3.0-onlyAuto-check passedDocuments & Office

Install PDF Translate

skills CLI
$ npx skills add breslee1707/VI-Translate --skill pdf-translate -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install breslee1707/VI-Translate pdf-translate --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
pdf-translate
GitHub stars
676
Token cost
~2k tokens
SKILL.md length
938 words
Files
230 (incl. scripts, references)
Skills in repo
2
Repo updated
First seen
Licence
AGPL-3.0-only

At a glance

Translate local PDFs, including safe prose on image-only scans, into Vietnamese or another supported Latin-script language while preserving layout, formulas, tables, and figures.

  • Works in 3 steps: Extract → Translate → Rebuild
  • PDF translation
  • SKILL.md covers Resolve the skill root, Choose a mode, Boundaries and Set up the runtime, plus 3 more sections
  • Calls python and python3

What it does

PDF Translate is an agent skill from breslee1707/VI-Translate. Translate local PDFs, including safe prose on image-only scans, into Vietnamese or another supported Latin-script language while preserving layout, formulas, tables, and figures. Use for PDF translation, OCR-assisted scan translation, batch translation, terminology-sensitive handoff translation, or diagnosing incomplete output. Do not use for targets requiring CJK, right-to-left, or complex-script shaping.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 234 other files, including scripts and reference files (for example `.github/workflows/android-build.yml`, `.github/workflows/macos-artifacts.yml` and `.github/workflows/release.yml`).

It sits in Documents & Office, covering Translation and PDF. The licence is AGPL-3.0-only.

When your agent uses it

  • PDF translation
  • OCR-assisted scan translation
  • Batch translation
  • Terminology-sensitive handoff translation

Example prompts

  • “/pdf-translate”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Extract
  2. Translate
  3. Rebuild

What it can do on your machine

Read from SKILL.md and the folder at commit 302a6da. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/, which the agent can run.

    Shell commands in SKILL.md call:

    • python
    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

PDF Translate loads about 2k tokens when it runs, and up to ~3.9k if it reads all its reference files. Until then it costs about 106 tokens; SKILL.md has 938 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~106
When it runs · the whole SKILL.md, loaded when a task matches
~2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from breslee1707/VI-Translate at commit 302a6da, republished under its AGPL-3.0-only licence (© breslee1707). 938 words, ~2,023 tokens.

Download SKILL.mdSave it as .claude/skills/pdf-translate/SKILL.md (or your agent's skills folder). This skill also uses 229 other files; get the full folder from GitHub.
name
pdf-translate
description
Translate local PDFs, including safe prose on image-only scans, into Vietnamese or another supported Latin-script language while preserving layout, formulas, tables, and figures. Use for PDF translation, OCR-assisted scan translation, batch translation, terminology-sensitive handoff translation, or diagnosing incomplete output. Do not use for targets requiring CJK, right-to-left, or complex-script shaping.
license
AGPL-3.0-only

PDF Translate

Translate a PDF with the bundled Code4Life engine. Keep the source file unchanged and produce a separate PDF with the same page structure.

When this skill runs inside the repository, first read agent-knowledge/index.md. For preservation or layout work, load its PDF engine, regression, and validation routes. These are the shared project instructions for Codex and Claude; do not duplicate them in this entrypoint.

Resolve the skill root

This skill may be installed globally while the user's files live elsewhere. Resolve the absolute directory containing this SKILL.md before running anything. Call its scripts and dependency files by absolute path; do not assume the current working directory is the skill directory.

Use the interpreter inside <skill-root>/.venv:

  • Windows: <skill-root>\.venv\Scripts\python.exe
  • macOS/Linux: <skill-root>/.venv/bin/python

Choose a mode

ModeTranslatorUse when
Google (default)translate.google.comBooks, batches, first drafts, or low token use
HandoffThe active agentTerminology, context, or translation quality matters

Default to Google. Offer handoff when the user asks for higher quality, rejects the Google result, or provides a short technical document.

Boundaries

  • Use the bundled pdf2zh/ core. Never substitute the PyPI pdf2zh package; the runner checks version 1.9.11 and preservation ruleset code4life-preservation-v1 and refuses an external core.
  • Google mode sends extracted document text to Google. Tell the user before processing sensitive material and obtain explicit confirmation unless their request already authorizes that disclosure. Handoff mode does not contact Google.
  • Supported targets are the Latin-script codes enforced by scripts/translate_pdf.py. CJK, right-to-left, Thai, Devanagari, and other complex-shaping targets are rejected because the bundled font and layout engine cannot render them reliably.
  • OCR is opt-in with --ocr standard|enhanced. It fails closed on unsafe tables, formulas, figures, code and ambiguous reading order; report every preserved region as partial instead of claiming the whole scan was translated.
  • Text inside detected tables, figures, contents pages, indexes, symbol lists, or references may intentionally remain in the source language. Report material untranslated regions as partial translation.
  • Preserve the source. Write results to a separate output directory. Do not pass --overwrite without explicit replacement authorization.

Read the preservation contract before changing layout behavior, diagnosing preserved pages, or investigating untranslated regions.

Set up the runtime

Use Python 3.11 or 3.12. Create <skill-root>/.venv and install <skill-root>/requirements.txt if the environment is absent or stale. Keep this environment separate from the user's project.

The source distribution downloads layout and font assets on its first translation, so the first run needs network access and takes longer. The packaged Windows app already contains these assets.

Windows:

powershell
python -m venv "<skill-root>\.venv"
& "<skill-root>\.venv\Scripts\python.exe" -m pip install -r "<skill-root>\requirements.txt"

macOS/Linux:

bash
python3 -m venv "<skill-root>/.venv"
"<skill-root>/.venv/bin/python" -m pip install -r "<skill-root>/requirements.txt"

Shared runner options include --target-language (default vi), --source-language auto, one-based --pages 1,3-5, --threads 1..8 (default 4; Google mode still sends one request at a time), --ignore-cache, and --overwrite.

Google mode

Run one command per file. Use absolute paths for the input and output directory.

Windows:

powershell
& "<skill-root>\.venv\Scripts\python.exe" "<skill-root>\scripts\translate_pdf.py" "<input.pdf>" --output-dir "<output-dir>"

macOS/Linux:

bash
"<skill-root>/.venv/bin/python" "<skill-root>/scripts/translate_pdf.py" "<input.pdf>" --output-dir "<output-dir>"

For a batch, process files individually and report progress. A file-specific failure must not stop the remaining files. A Google block or exhausted service outage pauses the whole queue; successful translations remain cached for a later retry, and no incomplete PDF is published for that interrupted file.

Google mode sends a page's segments in one request, one request at a time, because the free endpoint blocks a network that floods it. Never run several Google jobs in parallel.

If a run encounters HTTP 429 or a CAPTCHA, the runner stops the document and pauses the queue. For the next 10 minutes it refuses further Google runs before OCR/model work. This is the app's cooldown, not a prediction of Google's recovery time. Do not rerun it in a loop or try to get past the CAPTCHA. Report it, then offer a later rerun (finished segments are cached) or handoff mode.

Show full SKILL.md (332 more words)Show less

Handoff mode

Handoff extracts translatable segments to JSONL, lets the active agent translate them, then rebuilds the PDF. Warn about token and time cost before starting a large document. For long documents, suggest a representative sample such as --pages 1-5 first.

1. Extract

An output directory is not required during extraction because the pass-one PDF is discarded.

text
<python> <skill-root>/scripts/translate_pdf.py <input.pdf> --engine handoff --emit-segments <segments.jsonl>
2. Translate

Read segments.jsonl in manageable batches. Write one JSON object per line to translations.jsonl:

json
{"src":"exact source text","dst":"translated text"}

Copy each src value exactly. Preserve URLs, paths, identifiers, citation markers, and numbers.

Formula and code placeholders such as <b0></b0> are immutable. Every opening and closing tag must retain the same identifier, count, and order as the source. The loader rejects a record whose placeholders differ, leaving that segment untranslated.

Inline emphasis markers are immutable as balanced pairs: <s1>...</s1> is bold, <s2>...</s2> is italic, and <s3>...</s3> is bold italic. Complete style pairs may move with the translated phrase, but none may be dropped, duplicated, or cross-nested. Invalid style markup leaves the segment untranslated instead of silently losing emphasis.

3. Rebuild
text
<python> <skill-root>/scripts/translate_pdf.py <input.pdf> --engine handoff --segments <translations.jsonl> --output-dir <output-dir> --emit-segments <still-missing.jsonl>

The command prints the remaining untranslated segment count. If it is nonzero, translate still-missing.jsonl, append valid records to translations.jsonl, and rebuild again. Stop only at zero or when a segment cannot be translated safely; then report the exact remaining limitation.

Extraction and rebuild each run the layout pass, so handoff uses roughly twice the local PDF processing of Google mode in addition to the agent's translation work.

Verify before delivery

  1. Confirm the output exists and the source still exists unchanged.
  2. Confirm source and output page counts match.
  3. Extract text page by page and check for substantial untranslated passages, missing formulas, damaged URLs, or lost identifiers.
  4. When page rendering or image inspection is available, render every output page and inspect for blank pages, missing glyphs, clipping, overlap, and displaced tables or figures.
  5. If full visual inspection is unavailable, say which checks were completed. Do not present a partially verified or partially translated file as fully complete.

© breslee1707, AGPL-3.0-only. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 229 other files (scripts, references) in the repository root of breslee1707/VI-Translate.

  • SKILL.md
  • .claude/skills
  • .gitattributes
  • .github/assets/logo.png
  • .github/workflows/android-build.yml
  • .github/workflows/macos-artifacts.yml
  • .github/workflows/release.yml
  • .gitignore
  • AGENTS.md
  • CITATION.cff
  • CLAUDE.md
  • LICENSE
  • README.md
  • THIRD_PARTY_NOTICES.md
  • agent-knowledge/android.md
  • agent-knowledge/index.md
  • … and 214 more

Open the folder on GitHubat commit 302a6da

Compare with similar skills

PDF Translate next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

PDF Translate compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
PDF Translate this skillbreslee1707/VI-Translate676—~2kAutomated safety check: PassAGPL-3.0-only
Translate Bookdeusyu/translate-book2.1k—~5.5kAutomated safety check: NotesMIT
PDF Translatelxsssssss/pdf-translate102—~1.6kAutomated safety check: PassMIT
Print Compatible Book LayoutSaberOnGo/public-domain-books-translation267—~4.1kAutomated safety check: PassNone
PDF To HTMLdaymade/claude-code-skills1.4k—~1.8kAutomated safety check: PassMIT
PDF Math Translate Guidewentorai/research-plugins2981 repos~1.5kAutomated safety check: PassMIT

Similar skills

  • Translate Book

    deusyu/translate-book

    Translate books (PDF/DOCX/EPUB) into any language using parallel sub-agents.

    2.1k GitHub stars~5.5k tokensUpdated 16 days ago
    Documents & OfficeAuto-check: notes
  • PDF Translate

    lxsssssss/pdf-translate

    A skill your agent uses when translating PDF documents between languages while strictly preserving original layout, formatting, typography, tables, and signatures.

    102 GitHub stars~1.6k tokensUpdated 2 days ago
    Documents & OfficeAuto-check passed
  • Print Compatible Book Layout

    SaberOnGo/public-domain-books-translation

    A skill your agent uses when designing, translating, reviewing, or fixing LifeBook book/page layout, including print-compatible EPUB typography, Chinese title hierarchy, body rhythm, paragraph…

    267 GitHub stars~4.1k tokensUpdated 5 days ago
    Documents & OfficeAuto-check passed
  • PDF To HTML

    daymade/claude-code-skills

    Converts a PDF into one self-contained, readable HTML file that preserves images, tables, charts and reading order — optionally translating it into another language while keeping every figure.

    1.4k GitHub stars~1.8k tokensUpdated today
    Documents & OfficeAuto-check passed
  • PDF Math Translate Guide

    wentorai/research-plugins

    Translate scientific PDFs with preserved math formatting via PDFMathTranslate

    298 GitHub starsUsed in 1 repo~1.5k tokens
    Documents & OfficeAuto-check passed
  • Resume Assistant

    infometa/workbuddyskills

    面向中国求职者(应届 / 社招 / 出海)的可追溯 JD 定制简历助手:从 master 简历派生多版本,按 JD 重写并标注三维度防幻觉证据 (不编造数字 / 合法改写 / 防 AI 味),输出中英双版(本土化重写而非翻译)+ 战略附录 + ATS 友好 PDF。

    348 GitHub stars~1.7k tokensUpdated today
    Documents & OfficeAuto-check passed

More from breslee1707/VI-Translate

  • PDF Translate

    breslee1707/VI-Translate

    Translate or diagnose local text-based PDFs in this repository while preserving layout, formulas, tables, figures, styles, rotation, and technical glyphs.

    676 GitHub stars~269 tokensUpdated 9 days ago
    Auto-check passed

Questions about PDF Translate

What does PDF Translate do?

Translate local PDFs, including safe prose on image-only scans, into Vietnamese or another supported Latin-script language while preserving layout, formulas, tables, and figures. PDF Translate is an agent skill from breslee1707/VI-Translate. Translate local PDFs, including safe prose on image-only scans, into Vietnamese or another supported Latin-script language while preserving layout, formulas, tables, and figures.

When should I use PDF Translate?

PDF Translate fits situations like: PDF translation; OCR-assisted scan translation; batch translation; terminology-sensitive handoff translation.

How do I install PDF Translate in Claude Code?

Run `npx skills add breslee1707/VI-Translate --skill pdf-translate -a claude-code`. Or copy the skill folder (the breslee1707/VI-Translate repository) into .claude/skills/pdf-translate in your project. Claude Code loads it when a task matches its description.

How do I install PDF Translate in Codex?

Run `npx skills add breslee1707/VI-Translate --skill pdf-translate -a codex`. Or copy the skill folder (the breslee1707/VI-Translate repository) into .agents/skills/pdf-translate in your project. Codex loads it when a task matches its description.

Can I use PDF Translate in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add breslee1707/VI-Translate --skill pdf-translate -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pdf-translate, .gemini/skills/pdf-translate, .github/skills/pdf-translate and .opencode/skills/pdf-translate in your project.

What does PDF Translate need to run?

Going by SKILL.md and its folder, PDF Translate needs the command-line tools its instructions call (python and python3). Our summary lists: Python 3.

Does PDF Translate access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is PDF Translate safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does PDF Translate use?

PDF Translate is published under the AGPL-3.0-only licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does PDF Translate use?

About 2k tokens (SKILL.md is roughly 8.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.9k tokens, read only when the agent opens those files.

What are the alternatives to PDF Translate?

Skills that share tags, products or a category with PDF Translate: Translate Book (deusyu/translate-book, 2.1k stars), PDF Translate (lxsssssss/pdf-translate, 102 stars), Print Compatible Book Layout (SaberOnGo/public-domain-books-translation, 267 stars) and PDF To HTML (daymade/claude-code-skills, 1.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains PDF Translate?

breslee1707 (a GitHub user) maintains it in breslee1707/VI-Translate, which has 676 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 1, 2026.

Source: breslee1707/VI-Translate on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.