PDF转word python程序

# pip install pdf2docx #安装依赖库
from pdf2docx import Converter
 
pdf_file = r'C:\Users\Administrator\Desktop\新建文件夹\mednine.pdf'
docx_file = r'C:\Users\Administrator\Desktop\Python教程\02.docx'
 
# convert pdf to docx
cv = Converter(pdf_file)
cv.convert(docx_file, start=0, end=None)
cv.close()

https://www.jb51.net/article/210757.htm

#pip install pdf2docx
from os import execl
import docx
from pdf2docx import Converter
import os

pdf_file = r'C:\\Users\Admin\Desktop\\新建文件夹\\Understanding pollution behavior among farmers Exploring the influence of social networks and political identity on reducing straw burning in China.pdf'
docx_file = r'C:\\Users\Admin\Desktop\\新建文件夹\\数据123.docx'
# convert pdf to docx
cv = Converter(pdf_file)
cv.convert(docx_file, start=0, end=None)
#cv.convert(docx_file, start=0, end=None)
cv.close()
posted @ 2021-05-13 19:28  kuanleung  阅读(6)  评论(0)    收藏  举报  来源