File size: 262 Bytes
c6a18bd
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
# Import the required modules
from pdf2docx import Converter

def convertPDFtoWORD(pdfpath: str)->str:
    docx_file = pdfpath.split('.pdf')[0]+'.docx'
    converter = Converter(pdfpath)
    converter.convert(docx_file)
    converter.close()
    return docx_file