前提
windows10
python3.6.8
安装
pip install PyMuPDF==1.19.3 # 注意这里的版本, 是对应了我的python版本
pip install pdf2docx
使用
from pdf2docx import Converter
pdf_file = r'C:\Users\123\Desktop\test.pdf'
docx_file = r'C:\Users\123\Desktop\test.docx'
cv = Converter(pdf_file=pdf_file, password=None)
cv.convert(docx_file, start=0, end=None)
cv.close()