I am trying to convert Microsoft Docx into PDF file and using this python script
import os
import win32com. client
#pip install pywin32
wdFormatPDF = 17
in_file = "in_file/path/Input.docx"
out_file = "out_file/path/output.pdf"
word = win32com.client.Dispatch('Word.Application')
doc = word.Documents.Open(in_file)
doc.SaveAs(out_file, FileFormat = wdFormatPDF)
doc.Close()
word.Quit()``
But I got this error
```Encoding, InsertLineBreaks, AllowSubstitutions, LineEnding, AddBiDiMarks
pywintypes.com_error: (-214738676867, 'Exception occurred.', (0, 'Microsoft Word', 'Command failed', 'C:\\Program Files\\Microsoft Office\\Office12\\1033\\WDMAIN11.CHM', 587257, -214687359843090), None)`
And I also tried another plugin "from docx2pdf import convert" But the same error is coming. So plz suggest how to solve my problem.