python - pdf2docx

发布时间 2023-07-16 01:43:52作者: wstong

1. 安装pdf2docx

pip3 install pdf2docx -i https://pypi.tuna.tsinghua.edu.cn/simple

2. 简单使用

from pdf2docx import parse

pdf_file = 'test.pdf'
docx_file = 'test.docx'
parse(pdf_file, docx_file)

# 其他
parse(pdf_file, docx_file, start=0, end=3)
parse(pdf_file, docx_file, pages=[0, 3])

3. 效果图

image
image