unoconv / unoserver

MIT License
596 stars 81 forks source link

Failing to convert docx to pdf #15

Closed ccvivien closed 2 years ago

ccvivien commented 2 years ago

Hello,

I have some trouble understanding an error message. It occurs when my app tries to convert a docx file to pdf.

    cmd = 'unoconvert --convert-to pdf {} {}'.format(document_name, output_name).split()

    p = subprocess.Popen(cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
    output, error = p.communicate()

I get the following:

INFO:unoserver:Starting unoconverter. 
INFO:unoserver:Opening /tmp/3224c812-4046-418b-b2f7-52e122fc1ab4.docx 
Traceback (most recent call last): 
File "/usr/local/bin/unoconvert", line 8, in <module> 
    sys.exit(main()) 
File "/usr/local/lib/python3.9/dist-packages/unoserver/converter.py", line 245, in main 
    result = converter.convert( 
File "/usr/local/lib/python3.9/dist-packages/unoserver/converter.py", line 153, in convert 
    document = self.desktop.loadComponentFromURL( unoserver.converter.DisposedException: ./sfx2/source/doc/sfxbasemodel.cxx:2926 

The workflow is : For each docx template, I spawn a thread that build the final docx document from the template, and then the pdf. So I call unoconvert from within a python thread.

(I use https://docxtpl.readthedocs.io/en/latest/)

regebro commented 2 years ago

Is it a specific file? Could I in that case get a copy to test locally?

ccvivien commented 2 years ago

Hello, thank your for replying.

We haven't had the issue in a long time. So I don't have any file to reproduce the bug anymore.

I think we can close this issue for now. If it reproduces, I will open it again and share the files in question.