请告诉我如何将pdf转换为docx。我尝试使用pdfminer转换为html来提取文本,但仍然看起来不够好。
发布于 2021-01-28 14:37:35
pdf2docx
单击here,安装
Installation
pip安装pdf2docx或#下载软件包并安装您的环境python setup.py install
从pdf2docx导入转换器pdf_file = r'C:\Users\ABCD\Desktop\XYZ/Document1.pdf'#源文件docx_file = r'C:\Users\ABCD\Desktop\XYZ/sample.docx‘#目标文件# convert pdf to docx cv = Converter(pdf_file) cv.convert(docx_file,start=0,end=None) cv.close() #Output Parsing Page53: 53/53...正在创建第53页: 53/53...在6.258919400000195s.中终止
从pdf2docx导入解析pdf_file = r'C:\Users\ABCD\Desktop\XYZ/Document2.pdf‘# source file docx_file = r'C:\Users\ABCD\Desktop\XYZ/sample_2.docx’# destination file # convert pdf to docx parse(pdf_file,docx_file,start=0,end=None) # output Parsing Page53: 53/53...正在创建第53页: 53/53...在5.883666100000482s.中终止
发布于 2019-09-25 05:57:56
您可以使用像这样的在线工具:https://pdf2docx.com
如果您使用的是linux,请使用libreoffice api:
libreoffice --headless --convert-to=pdf example.docxhttps://stackoverflow.com/questions/57778665
复制相似问题