# 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