python-pdf转docx
作者:YXN-python 阅读量:52 发布日期:2024-05-23
from pdf2docx import Converter
def pdf_to_docx(pdf_path, docx_path):
# 创建一个转换器对象
converter = Converter(pdf_path)
# 将PDF转换为DOCX
converter.convert(docx_path, start=0, end=None)
# 关闭转换器
converter.close()
# 调用函数进行转换
pdf_path = "C:\\Users\\yxn\\Desktop\\简历.pdf"
docx_path = "C:\\Users\\yxn\\Desktop\\简历.docx"
pdf_to_docx(pdf_path, docx_path)
input("按任意键退出")
YXN-python
2024-05-23