AlJohri / docx2pdf

MIT License
506 stars 96 forks source link

docx2pf on macOS error #51

Open dmaleszyk opened 2 years ago

dmaleszyk commented 2 years ago

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?

tuckbloor commented 2 years ago

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

Mantany commented 1 year ago

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.

ryan-williams commented 1 year ago

I'm running into this with:

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]
ryan-williams commented 1 year ago

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