可将 PDF
转换成 docx
文件的 Python
库。该项目通过 PyMuPDF
库提取 PDF
文件中的数据,然后采用 python-docx
库解析内容的布局、段落、图片、表格等,最后自动生成 docx
文件。
pdf2docx
同时解析出了表格内容和样式,因此也可以作为一个表格内容提取工具。
pip install pdf2docx
from pdf2docx import parse
pdf_file = '/path/to/sample.pdf'
docx_file = 'path/to/sample.docx'
# convert pdf to docx
parse(pdf_file, docx_file)
output
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有