本 skill 提供 高精度 PDF转Word转换服务,最大程度保留原始文档的所有格式信息。
bash
python convert.py <输入PDF> --output <输出Word>
bash
python convert.py <PDF文件夹> --batch --output <输出文件夹>
bash
python convert.py 文档.pdf --pages 0-5 --output 文档.docx
首次使用需安装依赖:
bash
pip install pymupdf python-docx
bash
# 基本转换
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仿宋_GB2312Times New RomanTimes New RomanArial, HelveticaArial微软雅黑, Microsoft YaHei微软雅黑