Skip to content
cccskills
FreePublished on GitHub

visa-doc-translate

将签证申请文件(图片)翻译成英文,并创建包含原文和译文的双语PDF

The English summary is being prepared. Showing the original description.

See how to install

Files included (2)

  • SKILL.md3.4 KB
  • README.md1.7 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

您正在协助翻译用于签证申请的签证申请文件。

说明

当用户提供图像文件路径时,自动执行以下步骤,无需请求确认:

  1. 图像转换:如果文件是 HEIC 格式,使用 sips -s format png <input> --out <output> 将其转换为 PNG

  2. 图像旋转:

    • 检查 EXIF 方向数据
    • 根据 EXIF 数据自动旋转图像
    • 如果 EXIF 方向是 6,则逆时针旋转 90 度
    • 根据需要应用额外旋转(如果文档看起来上下颠倒,则测试 180 度)
  3. OCR 文本提取:

    • 自动尝试多种 OCR 方法:
      • macOS Vision 框架(macOS 首选)
      • EasyOCR(跨平台,无需 tesseract)
      • Tesseract OCR(如果可用)
    • 从文档中提取所有文本信息
    • 识别文档类型(存款证明、在职证明、退休证明等)
  4. 翻译:

    • 专业地将所有文本内容翻译成英文
    • 保持原始文档的结构和格式
    • 使用适合签证申请的专业术语
    • 保留专有名词的原始语言,并在括号内附上英文
    • 对于中文姓名,使用拼音格式(例如,WU Zhengye)
    • 准确保留所有数字、日期和金额
  5. PDF 生成:

    • 使用 PIL 和 reportlab 库创建 Python 脚本
    • 第 1 页:显示旋转后的原始图像,居中并缩放到适合 A4 页面
    • 第 2 页:以适当格式显示英文翻译:
      • 标题居中并加粗
      • 内容左对齐,间距适当
      • 适合官方文件的专业布局
    • 在底部添加注释:"This is a certified English translation of the original document"
    • 执行脚本以生成 PDF
  6. 输出:在同一目录中创建名为 <original_filename>_Translated.pdf 的 PDF 文件

支持的文档

  • 银行存款证明 (存款证明)
  • 收入证明 (收入证明)
  • 在职证明 (在职证明)
  • 退休证明 (退休证明)
  • 房产证明 (房产证明)
  • 营业执照 (营业执照)
  • 身份证和护照
  • 其他官方文件

技术实现

OCR 方法(按顺序尝试)

  1. macOS Vision 框架(仅限 macOS):

    import Vision
    from Foundation import NSURL
    
  2. EasyOCR(跨平台):

    pip install easyocr
    
  3. Tesseract OCR(如果可用):

    brew install tesseract tesseract-lang
    pip install pytesseract
    

必需的 Python 库

pip install pillow reportlab

对于 macOS Vision 框架:

pip install pyobjc-framework-Vision pyobjc-framework-Quartz

重要指南

  • 请勿在每个步骤都要求用户确认
  • 自动确定最佳旋转角度
  • 如果一种 OCR 方法失败,请尝试多种方法
  • 确保所有数字、日期和金额都准确翻译
  • 使用简洁、专业的格式
  • 完成整个流程并报告最终 PDF 的位置

使用示例

/visa-doc-translate RetirementCertificate.PNG
/visa-doc-translate BankStatement.HEIC
/visa-doc-translate EmploymentLetter.jpg

输出示例

该技能将:

  1. 使用可用的 OCR 方法提取文本
  2. 翻译成专业英文
  3. 生成 <filename>_Translated.pdf,其中包含:
    • 第 1 页:原始文档图像
    • 第 2 页:专业的英文翻译

非常适合需要翻译文件的澳大利亚、美国、加拿大、英国及其他国家的签证申请。

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

生产级 API 的 REST API 设计模式,包括资源命名、状态码、分页、过滤、错误响应、版本控制和速率限制。

The English summary is being prepared. Showing the original description.

xu-xiang/everything-claude-code-zh2KUpdated Mar 5, 2026

REST API设计模式,包括资源命名、状态码、分页、过滤、错误响应、版本控制和生产API的速率限制。

The English summary is being prepared. Showing the original description.

xu-xiang/everything-claude-code-zh2KUpdated Mar 5, 2026

撰写文章、指南、博客、教程、时事通讯等长篇内容,并根据提供的示例或品牌指南呈现独特的语言风格。当用户需要篇幅超过一段的精炼文字,且重视风格一致性、结构和可信度时,请使用此技能。

The English summary is being prepared. Showing the original description.

xu-xiang/everything-claude-code-zh2KUpdated Mar 5, 2026

编写文章、指南、博客、教程、时事通讯(Newsletter)等长内容,支持从示例或品牌指南中提取独特的语感语调。适用于需要撰写超过一个段落的精炼文本,尤其是对语气一致性、结构和可信度有较高要求时。

The English summary is being prepared. Showing the original description.

xu-xiang/everything-claude-code-zh2KUpdated Mar 5, 2026

根据提供的示例或品牌指导,以独特的语气撰写文章、指南、博客帖子、教程、新闻简报等长篇内容。当用户需要超过一段的精致书面内容时使用,尤其是当语气一致性、结构和可信度至关重要时。

The English summary is being prepared. Showing the original description.

xu-xiang/everything-claude-code-zh2KUpdated Mar 5, 2026

编写文章、指南、博客帖子、教程、新闻通讯(newsletter)以及其他长篇内容。这些内容具有从提供的示例或品牌指南中提取出的独特语气。当用户需要比段落更长的精美文案,且对语气一致性、结构和可信度有要求时,请使用此技能(Skill)。

The English summary is being prepared. Showing the original description.

xu-xiang/everything-claude-code-zh2KUpdated Mar 5, 2026

See all skills by xu-xiang

Report a problem with this skill