zrrrzzt / docker-unoconv-webservice

Dockerfile to run unoconv as a webservice
MIT License
96 stars 35 forks source link

Problem converting from .docx to image formats #10

Closed xverges closed 6 years ago

xverges commented 6 years ago

Hi. First time user of unvconv and of this docker image (that I pulled rather than building).

Error: Traceback (most recent call last):
  File "/usr/bin/unoconv", line 1030, in convert
    document.storeToURL(outputurl, tuple(outputprops) )
uno.IOException: SfxBaseModel::impl_store <private:stream> failed: 0xc10

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/unoconv", line 1275, in <module>
    main()
  File "/usr/bin/unoconv", line 1191, in main
    convertor.convert(inputfn)
  File "/usr/bin/unoconv", line 1032, in convert
    raise UnoException("Unable to store document to %s (ErrCode %d)\n\nProperties: %s" % (outputurl, e.ErrCode, outputprops), None)
  File "/usr/lib/python3/dist-packages/uno.py", line 397, in _uno_struct__getattr__
    return __builtin__.getattr(self.__dict__["value"],name)
AttributeError: ErrCode

    at ChildProcess.<anonymous> (/unoconvservice/node_modules/unoconv2/index.js:58:29)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
/unoconvservice/uploads/63783fde-81a3-4f41-8ea6-f7db8af76f28.docx deleted

Is this a bug, or am I misunderstanding unoconv capabilities

xverges commented 6 years ago

Looks like it is not related to this project

If I jump into the container's bash,

root@1352d2fb4cf2:/unoconvservice# unoconv --output=/adv5.png /adv5.docx
Traceback (most recent call last):
  File "/usr/bin/unoconv", line 1030, in convert
    document.storeToURL(outputurl, tuple(outputprops) )
uno.IOException: SfxBaseModel::impl_store <file:///adv5.png> failed: 0xc10

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/unoconv", line 1275, in <module>
    main()
  File "/usr/bin/unoconv", line 1191, in main
    convertor.convert(inputfn)
  File "/usr/bin/unoconv", line 1032, in convert
    raise UnoException("Unable to store document to %s (ErrCode %d)\n\nProperties: %s" % (outputurl, e.ErrCode, outputprops), None)
  File "/usr/lib/python3/dist-packages/uno.py", line 397, in _uno_struct__getattr__
    return __builtin__.getattr(self.__dict__["value"],name)
AttributeError: ErrCode
zrrrzzt commented 6 years ago

I don't think you can convert from a document format to an image format.

This project is just a convenience wrapper/service around unoconv and it says "Not all formats that can be imported can be exported and vice versa" on the label :-)

xverges commented 6 years ago

https://github.com/dagwieers/unoconv/issues/167 seems to indicate that it should be possible: the project owner says that it used to work. And also that the problem is clearly not caused by this project's wrapping. My apologies for the noise :-)

zrrrzzt commented 6 years ago

@xverges activity is not noise :-)

If it "used to work" and you know how to build your own images you could try to create another base image with older versions of libreOffice and/or unoconv.

xverges commented 6 years ago

If it "used to work" and you know how to build your own images you could try to create another base image with older versions of libreOffice and/or unoconv.

Might try, thanks. This is getting into a serious case of yak shaving :-)

zrrrzzt commented 6 years ago

btw this works from the terminal (if you have Libre Office installed) soffice --convert-to png myfile.pdf --headless