将 pdf 转换为 docx 的开源 Python 库 PyMuPDF

fge1年前 ⋅ 1422 阅读

可将 PDF 转换成 docx 文件的 Python 库。该项目通过 PyMuPDF 库提取 PDF 文件中的数据,然后采用 python-docx 库解析内容的布局、段落、图片、表格等,最后自动生成 docx 文件。

https://github.com/dothinking/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)

全部评论: 0

    相关推荐