Код: Выделить всё
pip install pdf2docx
Код: Выделить всё
from pdf2docx import Converter
pdf_file = '/path/to/sample.pdf'
docx_file = 'path/to/sample.docx'
# convert pdf to docx
cv = Converter(pdf_file)
# all pages by default
cv.convert(docx_file)
cv.close()