docx2pdf icon indicating copy to clipboard operation
docx2pdf copied to clipboard

docx2pf on macOS error

Open dmaleszyk opened this issue 4 years ago • 4 comments

Hi,

I can't convert docx to pdf on macOS. Everytime I'm receiving error: 'result': 'error', 'error': 'Error: Message not understood.'} An exception has occurred, use %tb to see the full traceback. anaconda3/lib/python3.8/site-packages/docx2pdf/init.py", line 72, in macos sys.exit(1) Library is working perfectly on windows 11 anaconda IDE. Could you help me with solving the issue?

dmaleszyk avatar Dec 16 '21 11:12 dmaleszyk

Do You have windows installed on your Mac? I need to install the free trial for testing

tuckbloor avatar Aug 09 '22 10:08 tuckbloor

Can confirm the issue, I used icloud to safe/get the word documents from. Moving from icloud to local storage fixed the issue for me.

Mantany avatar Sep 15 '22 19:09 Mantany

I'm running into this with:

  • macOS 12.6 (M1 macbook)
  • Python 3.9.13
  • docx2pdf 0.1.8 (installed via pip install docx2pdf)
  • Word 16.67 (22111300)

My files are in a local directory, not in iCloud or anything.

from docx2pdf import convert
convert('example.docx', 'example.pdf')
#   0%|                                                                                                                                     | 0/1 [00:00<?, ?it/s]
# {'input': '$HOME/example.docx', 'output': '$HOME/example.pdf', 'result': 'error', 'error': 'Error: Message not understood.'}
#   0%|                                                                                                                                     | 0/1 [00:02<?, ?it/s]
  • Word opens
    • On the first attempt, I had to grant it permission to access that file
    • On subsequent attempts, the "home" modal open (with template documents etc.)
  • I see the error message above, and my python repl exits
  • Word remains open, with the .docx open

ryan-williams avatar Nov 30 '22 02:11 ryan-williams

Having debugged it a bit further, I suspect my issue is that I don't have an Office365 subscription on my macbook, so I'm unable to save or edit Word docs!

image

My docx's are simple enough that LibreOffice seems to work, thanks to this SO:

soffice --headless --convert-to pdf:writer_pdf_Export --outdir out/ input.docx

ryan-williams avatar Dec 02 '22 15:12 ryan-williams