import os
import sys
from docx2pdf import convert
convert("D:\Dev2Ease\PyC\Output Word","D:\Dev2Ease\PyC\Output Pdf")
print ("All the files have been converted to pdf")
for the above-mentioned code, I get an error while the execution is in progress...however the conversion from docx to pdf is happening. just that I keep getting below error. can someone help me here?
Traceback (most recent call last):
File "D:/Dev2Ease/PyC/word2pdf.py", line 5, in <module>
convert("D:\Dev2Ease\PyC\Output Word","D:\Dev2Ease\PyC\Output Pdf")
File "C:\Users\Shailesh\AppData\Roaming\Python\Python310\site-packages\docx2pdf\__init__.py", line 106, in convert
return windows(paths, keep_active)
File "C:\Users\Shailesh\AppData\Roaming\Python\Python310\site-packages\docx2pdf\__init__.py", line 25, in windows
doc = word.Documents.Open(str(docx_filepath))
File "<COMObject <unknown>>", line 5, in Open
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, 'Microsoft Word', 'The file appears to be corrupted.', 'wdmain11.chm', 25272, -2146822496), None)