abbyy-batch-pdf2docx

Batch-convert PDFs to DOCX using ABBYY FineReader 15 (FineCmd.exe), with resume, watchdog, and auto-retry anti-crash mechanisms. Suitable for converting large numbers of scanned PDFs or contract/bid PDFs into editable Word documents.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "abbyy-batch-pdf2docx" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-7d0c96cf36cd2b3eed9cdb8cc2258bbca9a4f1bbb222e4f36768746f1dbdbbca. Verify the upstream source and version against https://skillhub.cn/skills/user_e2ff9e78/abbyy-ocr before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Batch-convert PDFs to DOCX using ABBYY FineReader 15 (FineCmd.exe), with resume, watchdog, and auto-retry anti-crash mechanisms. Suitable for converting large numbers of scanned PDFs or contract/bid PDFs into editable Word documents.

0 Downloads

Introduction source: third_party · user_e2ff9e78 · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Limits and differences
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: abbyy-batch-pdf2docx
description: 使用 ABBYY FineReader 15(FineCmd.exe)批量将 PDF 文件转换为 DOCX 格式,含断点续传、自看门狗、自动重试等防崩溃机制。适用于需要将大量扫描 PDF 或合同/标书 PDF 转换为可编辑 Word 文档的场景。
agent_created: true

ABBYY FineReader 15 批量 PDF → DOCX 转换

功能

使用 ABBYY FineReader 15 的 CLI 工具 FineCmd.exe,批量将指定目录下所有 PDF 文件转换为同目录同名的 DOCX 文件(OCR 识别 + 格式导出),内置三层防崩溃保护。

前提条件

  • 已安装 ABBYY FineReader 15(默认路径 C:\Program Files\ABBYY FineReader 15\FineCmd.exe)
  • 拥有合法的 ABBYY FineReader 许可证
  • 操作系统:Windows

使用方法

方法一:运行增强版脚本(推荐 — 自带防崩溃 + 断点续传)

python3 scripts/batch_abbyy_convert_resumable.py

该脚本是集成度最高的版本,内置全部防崩溃机制,建议所有场景使用。

功能:

  1. 扫描配置的目标目录下所有 PDF 文件
  2. 读取断点检查点,跳过已完成文件
  3. 逐一调用 FineCmd.exe 进行 OCR 识别并导出为 DOCX
  4. 每转换一个文件实时保存断点
  5. 进程异常退出后自动重启(最多 10 次)
  6. 输出最终成功/失败报告

方法二:运行基础版脚本

python3 scripts/batch_abbyy_convert.py

适用于小批量、一次性转换,占用资源更少。

方法三:看门狗守护(额外保护层)

powershell -File scripts/watchdog_abbyy.ps1

每隔 60 秒检测一次转换进程是否在运行,异常退出后自动重启。

三层防崩溃架构

第1层:Checkpoint 断点续传(脚本内建)

增强版脚本在 ROOT_DIR 下创建 _abbyy_checkpoint.json 文件:

{
  "2024/合同/第一批 招标文件.pdf": {"status": "skip", "msg": "", "time": "15:28:22"},
  "2025/投标/XX公司.pdf": {"status": "ok", "msg": "256KB", "time": "15:27:05"},
  "_meta": {"total_pdfs": 662, "done": 228, "failed": 0}
}
  • ok — 成功转换
  • skip — 已有 DOCX
  • fail — 超过重试次数

恢复流程: 进程被杀后重新运行 → 自动读取检查点 → 跳过已完成 → 从断点继续

第2层:信号处理(优雅退出)

注册 SIGINT/SIGTERM 信号处理器:

  • Ctrl+C 或系统终止 → 保存当前进度到检查点 → 干净退出
  • 下次重启自动从断点继续

第3层:自看门狗(崩溃自动重启)

增强版脚本的 __main__ 块包含自重启循环:

try:
    main()
except:
    pass  # 捕获任何崩溃
# 检查任务是否完成
if 还有未处理文件:
    自动重启 main()
  • 最多自动重启 10 次
  • 每次重启间隔 5 秒
  • 重启后读取检查点,从断点继续

额外保护:单文件自动重试

每个 PDF 转换失败后自动重试(最多 3 次),避免偶发性 OCR 错误导致整个任务中断。

防崩溃故障恢复总流程

                            ┌─────────────────────┐
                            │   启动转换脚本        │
                            └─────────┬───────────┘
                                      │
                            ┌─────────▼───────────┐
                            │   读取检查点          │
                            │   跳过已完成文件       │
                            └─────────┬───────────┘
                                      │
                            ┌─────────▼───────────┐
                   ┌────────┤   逐一转换PDF         │
                   │        │   实时保存检查点       │
                   │        └─────────┬───────────┘
                   │                  │
        ┌──────────┴──────┐    ┌──────▼──────┐
        │ 进程被强杀/Ctrl+C │    │  全部完成    │
        └──────────┬──────┘    └──────┬──────┘
                   │                  │
        ┌──────────▼──────┐          │
        │ 检查点已保存     │          │
        │ 重新运行脚本 ────┼──自动跳过─┘
        │ 从断点继续      │
        └─────────────────┘

配置说明

编辑 scripts/batch_abbyy_convert_resumable.py 文件顶部变量:

变量 默认值 说明
ABBYY_FINECMD C:\Program Files\ABBYY FineReader 15\FineCmd.exe FineCmd.exe 安装路径
ROOT_DIR 目标文件夹 待转换的 PDF 所在目录(递归搜索)
OCR_LANG ChinesePRC OCR 识别语言(简体中文)
MAX_RETRIES 3 单个文件最大重试次数
FILE_TIMEOUT 900 单文件超时秒数
CHECKPOINT_FILE ROOT_DIR / _abbyy_checkpoint.json 断点检查点文件路径
MAX_CRASH_RESTARTS 10 进程崩溃后最大自重启次数

语言参数说明

语言 参数值
简体中文 ChinesePRC
繁体中文 ChineseTaiwan
英文 English
日文 Japanese
韩文 Korean
多语言混合 Mixed

注意事项

  1. FineCmd.exe 必须通过 Python subprocess 调用(直接 Bash 调用可能返回非零退出码但无输出)。
  2. 路径中如含中文或空格,必须使用原始字符串(r"...")或正斜杠。
  3. 每个文件转换时间取决于页数,平均 15-30 秒/份。
  4. 脚本为每个转换生成临时 XML 报告文件(文件名以 _ 开头),成功后自动删除。
  5. 检查点文件 _abbyy_checkpoint.json 不要手动删除(除非要重新开始)。
  6. 故障排查:转换失败时检查 FineCmd.exe 路径、ABBYY 许可证状态、PDF 是否损坏。

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value92/100

Highlights

  • 解决批量 PDF 转 DOCX 的高频刚需场景,适用于合同、标书等大量文档处理
  • 内置断点续传、自动重试、看门狗等多层防崩溃机制,显著提升大批量任务可靠性
Trigger Precision95/100

Highlights

  • 触发描述完整覆盖核心功能(批量转换、OCR 识别、防崩溃机制)
  • 明确指定了目标工具(ABBYY FineReader 15)和使用场景(扫描 PDF、合同/标书)
Structure and Standards95/100

Highlights

  • 文档结构完整,包含功能、前提条件、多种使用方法、架构详解、配置说明
  • 提供清晰的三层防崩溃架构说明和故障恢复流程图,便于理解执行流程
Execution Reliability90/100

Highlights

  • 工具来源明确(FineCmd.exe),参数配置清晰,支持多语言 OCR
  • 内置断点续传、信号处理、自重启、单文件重试等多重保护机制,确保任务可靠性
Evidence Verifiability (mean of the first four)93/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Invoke commands or scripts

    Read the script and arguments first. Use ordinary privileges and a scoped directory; confirm installation or execution in your host tool.

    Mentioned in main document · lines 48

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.