[python办公] pdf转word导师发的论文,转成word好用gpt翻译,pdf有好多烦人的断行

pdf转word导师发的论文,转成word好用gpt翻译,pdf有好多烦人的断行

from pdf2docx import Converter
from pdf2docx import parse
import os
pdf_Dir = r"C:\Users\HP\Desktop\论文"
list_pdf_file = os.listdir(pdf_Dir)
for pdf_file in list_pdf_file:
    
    docx_filename_all = os.path.join(pdf_Dir,pdf_file.replace(".pdf",".docx"))
    # 方式1:
    parse(os.path.join(pdf_Dir,pdf_file), docx_filename_all)

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_40293999/article/details/129916629
今日推荐