PDF to DOCX
Convert PDF files to editable Word (.docx) format using MinerU.
⚠️ Token required. flash-extract does not support DOCX output. You must configure a token via mineru-open-api auth before using this skill.
⚠️ Output to file required. DOCX is a binary format and cannot be streamed to stdout — you must always specify -o <directory>.
Install
CODEBLOCK0
Authentication
Token required — create one at https://mineru.net/apiManage/token:
CODEBLOCK1
Quick Start
CODEBLOCK2
Capabilities
- - Supported input: .pdf (local file or URL)
- Output format: Word (.docx) via INLINECODE3
- Token required (
mineru-open-api auth or MINERU_TOKEN env) - INLINECODE6 is mandatory — DOCX cannot stream to stdout
- Language hint with
--language (default: ch, use en for English) - Page range with
--pages (e.g. 1-10) - Batch mode supported: INLINECODE12
Notes
- -
flash-extract does NOT support DOCX output — always use extract with token - DOCX output cannot be streamed to stdout;
-o flag is required - Use
--model vlm for PDFs with complex layouts, tables, or mixed content - Use
--model pipeline if you need guaranteed fidelity with no hallucination risk - Output directory will be created if it does not exist
- All progress/status messages go to stderr
- MinerU is open-source by OpenDataLab (Shanghai AI Lab): https://github.com/opendatalab/MinerU
PDF 转 DOCX
使用 MinerU 将 PDF 文件转换为可编辑的 Word (.docx) 格式。
⚠️ 需要 Token。 flash-extract 不支持 DOCX 输出。使用此技能前,必须通过 mineru-open-api auth 配置 token。
⚠️ 需要输出到文件。 DOCX 是二进制格式,无法直接输出到标准输出——必须始终指定 -o <目录>。
安装
bash
npm install -g mineru-open-api
或通过 Go (macOS/Linux):
go install github.com/opendatalab/MinerU-Ecosystem/cli/mineru-open-api@latest
身份验证
需要 Token——在 https://mineru.net/apiManage/token 创建:
bash
mineru-open-api auth # 交互式 Token 设置
export MINERU_TOKEN=your-token # 或通过环境变量设置
快速开始
bash
将 PDF 转换为 DOCX(需要 token,-o 为必选项)
mineru-open-api extract report.pdf -f docx -o ./out/
从 URL 转换
mineru-open-api extract https://example.com/report.pdf -f docx -o ./out/
带语言提示
mineru-open-api extract report.pdf -f docx --language en -o ./out/
使用 VLM 模型提高布局准确性(复杂 PDF)
mineru-open-api extract report.pdf -f docx --model vlm -o ./out/
批量转换多个 PDF
mineru-open-api extract *.pdf -f docx -o ./out/
功能特性
- - 支持的输入:.pdf(本地文件或 URL)
- 输出格式:通过 -f docx 输出 Word (.docx)
- 需要 Token(mineru-open-api auth 或 MINERU_TOKEN 环境变量)
- -o <目录> 为必选项——DOCX 无法输出到标准输出
- 通过 --language 设置语言提示(默认:ch,英文使用 en)
- 通过 --pages 设置页面范围(例如 1-10)
- 支持批量模式:extract *.pdf -f docx -o ./out/
注意事项
- - flash-extract 不支持 DOCX 输出——始终使用带 token 的 extract
- DOCX 输出无法输出到标准输出;必须使用 -o 标志
- 对于布局复杂、含表格或混合内容的 PDF,使用 --model vlm
- 如需保证高保真度且无幻觉风险,使用 --model pipeline
- 如果输出目录不存在,将自动创建
- 所有进度/状态信息输出到 stderr
- MinerU 由 OpenDataLab(上海人工智能实验室)开源:https://github.com/opendatalab/MinerU