AlJohri / docx2pdf

MIT License
518 stars 98 forks source link

AttributeError #21

Closed Jonathan-Jacob closed 4 years ago

Jonathan-Jacob commented 4 years ago

Until recently, it worked fine. Now, when using docx2pdf, I get this error.

C:\Git\JonathanJacob\Poi>docx2pdf test.docx test.pdf 0%| | 0/1 [00:00<?, ?it/s]Traceback (most recent call last): File "c:\users\jonathan jacob\appdata\local\programs\python\python38-32\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\users\jonathan jacob\appdata\local\programs\python\python38-32\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\Jonathan Jacob\AppData\Local\Programs\Python\Python38-32\Scripts\docx2pdf.exe__main.py", line 7, in File "c:\users\jonathan jacob\appdata\local\programs\python\python38-32\lib\site-packages\docx2pdf__init.py", line 170, in cli convert(args.input, args.output, args.keep_active) File "c:\users\jonathan jacob\appdata\local\programs\python\python38-32\lib\site-packages\docx2pdf__init__.py", line 106, in convert return windows(paths, keep_active) File "c:\users\jonathan jacob\appdata\local\programs\python\python38-32\lib\site-packages\docx2pdf\init__.py", line 33, in windows doc.SaveAs(str(pdf_filepath), FileFormat=wdFormatPDF) File "c:\users\jonathan jacob\appdata\local\programs\python\python38-32\lib\site-packages\win32com\client\dynamic.py", line 527, in getattr__ raise AttributeError("%s.%s" % (self.username, attr)) AttributeError: Open.SaveAs 0%| | 0/1 [00:00<?, ?it/s]

AlJohri commented 4 years ago

@AxlNase sometimes closing everything (all word documents, pdf documents, and file explorer windows) and trying again seems to do the trick.

  1. can you reproduce this bug consistently?
  2. if so, does it only occur with this particular word file? try another file and see if its the same issue
Jonathan-Jacob commented 4 years ago

Thanks so much @AlJohri for your quick reply. After restarting my computer, the bug disappeared.