You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
357 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

from pdf2docx import Converter
# PDF文件路径
pdf_file = 'TestDataPlan-CET.pdf'
# 输出Word文档路径
word_file = 'd.docx'
# 初始化转换器
cv = Converter(pdf_file)
# 将PDF转换为Word默认全部页面可以指定页码范围pages=[0, 1, 2]
cv.convert(word_file, start=0, end=None)
# 关闭转换器,释放资源
cv.close()