← 返回
未分类 Key 中文

PDF Master Translator

A highly robust, multi-agent pipeline for translating and reconstructing complex, image-heavy, or scanned PDF documents (especially engineering, scientific,...
高度稳健的多智能体流水线,用于翻译和重建复杂、图像密集型或扫描的PDF文档(尤其是工程、科学等领域...
lingqing lingqing 来源
未分类 clawhub v1.0.0 1 版本 99843 Key: 需要
★ 0
Stars
📥 636
下载
💾 0
安装
1
版本
#latest

概述

PDF Master Translator (V10 Architecture)

This skill provides a battle-tested, "bulletproof" pipeline for translating complex PDF documents. It was forged from extensive trial and error on NASA engineering specifications.

Do NOT attempt to use simple OCR or zero-shot LLM translation for complex engineering documents. They will fail. Use the translator_engine_v10.py script provided in this skill.

Core Capabilities & The V10 Pipeline

This skill relies on a Python script (scripts/translator_engine_v10.py) that implements a specific, multi-agent workflow:

  1. Layout & Physical Isolation (Masking):
    • Never ask an LLM to "ignore the picture and translate the text" on a messy scan.
    • The pipeline first detects figures and tables.
    • It physically whites out (masks) these regions on a temporary image.
    • The "clean" image is sent for translation, eliminating visual hallucinations.
    • Original figures are extracted, converted to Base64, and safely appended to the final HTML/PDF.
  1. Holographic Context Injection:
    • Masking creates fragmented sentences around the masked areas.
    • To prevent the translation Agent from producing out-of-context or broken translations, the pipeline injects the raw, unformatted text stream of the entire page as a reference dictionary. The Agent uses this context to seamlessly bridge the visual gaps.
  1. Protocol Downgrade (XML over JSON):
    • Forcing LLMs to output thousands of words of Markdown inside a strict JSON structure is fragile and prone to escaping errors.
    • The engine enforces simple XML tags (
      , ,
      ) for structural routing.
  1. Strict Math & Symbol Rendering:
    • Standard PDF renderers (like WeasyPrint) cannot execute JavaScript (MathJax).
    • The script uses regex to intercept all LaTeX ($...$ or $$...$$) and calls an external API (math.vercel.app) to render them as high-quality, embeddable SVG images.
    • The Prompt strictly mandates the format $Variable$: Description for symbol glossaries, ensuring visual consistency.
  1. Terminal Defense (Sanity Cleaner):
    • The final step before PDF generation is a regex sweep to remove any leaked LLM artifacts (like ```markdown wrappers) or error placeholders (like RetryError[]) that might have survived the pipeline.

Usage Instructions

To use this skill, execute the translator_engine_v10.py script.

Prerequisites

Ensure the required dependencies are installed (typically handled via uv run if inline metadata is used) and the Gemini API key is set.

export GEMINI_API_KEY="your_api_key_here"
# If a proxy is required for your network:
export HTTPS_PROXY="http://127.0.0.1:10809" 

Execution

Run the script, providing the path to the target PDF and the specific page range.

uv run ~/.npm-global/lib/node_modules/openclaw/skills/pdf-master-translator/scripts/translator_engine_v10.py /path/to/target.pdf --start <start_page> --end <end_page>

Important Operational Rules:

  • Always specify --start and --end explicitly.
  • For very large documents (>20 pages), it is highly recommended to run this using nohup ... & in the background, as the multi-agent cross-checking and API rate-limiting sleep cycles make this a long-running process.

Output

The script will generate a new PDF named [OriginalName]_V10_FINAL_P[start]-[end].pdf in the current working directory.

This PDF will feature:

  • A clear --- Page X --- divider for continuous reading.
  • Consistent Header and Footer markdown tables.
  • SVG-rendered math formulas.
  • A dedicated [ 原文图表/示意图 ] section at the bottom of relevant pages containing the extracted original diagrams.
  • (If applicable) A [ 图例符号说明 ] section containing translations of text found inside the diagrams.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-01 18:00 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

office-efficiency

Word / DOCX

ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 458 📥 152,348
office-efficiency

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 928 📥 186,912
office-efficiency

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 382 📥 144,889