/install pdf2word-skills
PDF to Word Converter
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
- Initialize the OCR engine by downloading the binaries:
bash scripts/install.sh - Install the required Python dependencies:
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 \x3Cinput.pdf> \x3Coutput.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
- The script calls
docr, which uses the specified OCR model (RapidOCR by default) to read text from the scanned PDF. - The extracted text is temporarily stored.
- The
python-docxlibrary is used to read the temporary text and construct a formatted Word document. - Temporary files are cleaned up automatically.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install pdf2word-skills - 安装完成后,直接呼叫该 Skill 的名称或使用
/pdf2word-skills触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Pdf2word Skills 是什么?
Convert scanned PDF documents into Word text documents using a free, local OCR engine or remote api. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 203 次。
如何安装 Pdf2word Skills?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install pdf2word-skills」即可一键安装,无需额外配置。
Pdf2word Skills 是免费的吗?
是的,Pdf2word Skills 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Pdf2word Skills 支持哪些平台?
Pdf2word Skills 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Pdf2word Skills?
由 scottkiss(@scottkiss)开发并维护,当前版本 v1.0.0。