In this article we are going to explore how we can convert ant PDF file into editable doc (Word) file and can perform many more customization

Installation of libraries

pip install pdf2docx

Importing libraries

from pdf2docx import Converter

Implementation

Here we are going to take 1 pfd file for example ‘pdf1.pdf’ and we are going to convert to docx file. Remember that the sample pdf file should be present in the same directory as the project location as of now .

pdf ='pdf1.pdf'
word ='word1.docx'
cv = Converter(pdf)
cv.convert(word,start=0,end=None)
cv.close()

This converts the pdf into docx file and even we can edit it as we want. We will be able to locate the file in the same directory as the project.