1、使用Python 3.9.5 + pdf2docx
2、安装pdf2docx,安装可能会遇到各种问题bug
pip install pdf2docx -i http://mirrors.aliyun.com/pypi/simple
阿里:http://mirrors.aliyun.com/pypi/simple
中国科学技术大学:https://pypi.mirrors.ustc.edu.cn/simple/
清华大学:https://pypi.tuna.tsinghua.edu.cn/simple
3、转换只有一句代码
parse("pdf名称","word文件名称")
# coding=utf-8
import argparse
from pdf2docx import parse
parser = argparse.ArgumentParser()
parser.add_argument("-filepath", dest="filepath", type=str)
args = parser.parse_args()
filename = args.filepath
parse(filename,filename+".docx")
#####python3 '脚本绝对路径' -filapath='pdf文件绝对路径'