← 返回
未分类 中文

Pdf2word Skills

Convert scanned PDF documents into Word text documents using a free, local OCR engine or remote api.
使用免费本地OCR引擎或远程API将扫描PDF转换为Word文档
scottkiss
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 602
下载
💾 40
安装
1
版本
#latest

概述

PDF to Word Converter

🇨🇳 简体中文 / Simplified Chinese

A skill to extract text from scanned PDF documents and convert them into reusable Word (.docx) files using the free, local docr OCR engine.

Prerequisites

  1. Initialize the OCR engine by downloading the binaries:

```bash

bash scripts/install.sh

```

  1. Install the required Python dependencies:

```bash

pip install -r scripts/requirements.txt

```

Usage

Run the Python script passing the input PDF file and the desired output .docx file path. You can also append any additional standard docr arguments (such as engine preferences).

python scripts/pdf2word.py <input.pdf> <output.docx> [docr_args...]

Examples

Convert a single file with the default local engine:

python scripts/pdf2word.py sample.pdf sample_output.docx

Using Other API Engines

By default, the script uses the local RapidOCR engine. The underlying docr tool also supports other engines like the Google Gemini API for potentially higher recognition accuracy on complex layouts.

To use Gemini, first configure your API key:

mkdir -p ~/.ocr
echo "gemini_api_key=your_gemini_key" > ~/.ocr/config

Then pass the -engine gemini argument to the script:

python scripts/pdf2word.py sample.pdf sample_output.docx -engine gemini

If your document has tables, you can force Gemini to output them in Markdown format so the script can parse them into native Word tables:

python scripts/pdf2word.py sample.pdf sample_output.docx -engine gemini -prompt "Extract all text and preserve tables in Markdown format using | symbols."

How it Works

  1. The script calls docr, which uses the specified OCR model (RapidOCR by default) to read text from the scanned PDF.
  2. The extracted text is temporarily stored.
  3. The python-docx library is used to read the temporary text and construct a formatted Word document.
  4. Temporary files are cleaned up automatically.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 14:58 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,057 📥 796,719
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 323,869
ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,351 📥 317,796