本 skill 提供高精度PDF转Word转换服务,最大程度保留原始文档的所有格式信息。
python convert.py <输入PDF> --output <输出Word>
python convert.py <PDF文件夹> --batch --output <输出文件夹>
python convert.py 文档.pdf --pages 0-5 --output 文档.docx
首次使用需安装依赖:
pip install pymupdf python-docx
# 基本转换
python convert.py 报告.pdf --output 报告.docx
# 批量转换文件夹中所有PDF
python convert.py ./pdfs/ --batch --output ./words/
# 转换前10页
python convert.py 文档.pdf --pages 0-9 --output 文档.docx
# 指定起始页和结束页
python convert.py 长文档.pdf --start 5 --end 15 --output 部分.docx
.docx 格式,可用 Microsoft Word 或 WPS 打开
本 skill 基于以下技术实现:
提取的格式信息包括:
| PDF字体 | Word字体 |
|--------|---------|
| 宋体, SimSun | 宋体 |
| 黑体, SimHei | 黑体 |
| 楷体, SimKai | 楷体_GB2312 |
| 仿宋, SimFang | 仿宋_GB2312 |
| Times New Roman | Times New Roman |
| Arial, Helvetica | Arial |
| 微软雅黑, Microsoft YaHei | 微软雅黑 |
共 1 个版本