Created
April 27, 2024 06:53
-
-
Save documentprocessing/9976625c549c45c46e77fb2d2b80c729 to your computer and use it in GitHub Desktop.
Convert PDF files to DOCX with pdf2docx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pdf2docx import Converter | |
# Specify the PDF file to convert | |
pdf_file = 'example.pdf' | |
docx_file = 'output.docx' | |
# Create a Converter object and convert the PDF to DOCX | |
cv = Converter(pdf_file) | |
cv.convert(docx_file, start=0, end=None) | |
cv.close() | |
print("Conversion completed! The DOCX file has been created.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment