AlJohri / docx2pdf

MIT License
497 stars 94 forks source link

PySide Threading and cx_freeze packaging #68

Closed dhabbyc closed 2 years ago

dhabbyc commented 2 years ago

Hello,

I have a problem running a PySide2 application with a main use of docx2pdf through docx2pdf.convert. I'm not completly sure is a problem of docx2pdf or a cx_freeze problem.

The application runs the conversion process on a single qt thread several times (I have a lot of docx documents), for each one of them I use docx2pdf.convert. If I bundle the application with cx_freeze leaving the background console, everything works as expected. But if I remove (hide) the background console (cx_freeze.Executable(..., base = "Win32GUI",...,)), the application runs, but at the first use of docx2pdf, the thread closes (no pdf file is created), and the main thread thinks the child thread has finished.

I have tried to play around with pythoncom.CoInitialize with no success.

Any ideas?

dhabbyc commented 2 years ago

So, the problem is the progress bar, if you disable it (from the source code), the problem disappears.

Maybe doxc2pdf could provide the option to disable the progress bar, from both uses: script API and batch.