unoconv export .xlsx file into image like png

↘锁芯ラ 提交于 2020-01-04 02:30:12

问题


I have successfully installed unoconv in my ubuntu 14.04 64 bit.

I want to export the first sheet of an .xlsx file into image like png or jpg.

I tried

unoconv -l & 9998 ## this is to start the python listener
unoconv -f png abc.xlsx

I get the following:

unoconv: UnoException during export phase:
Unable to store document to file:///var/virtual/abc.png (ErrCode 3088)

Properties: ((com.sun.star.beans.PropertyValue){ Name = (string)"FilterName", Handle = (long)0x0, Value = (any){ (string)"draw_png_Export" }, State = (com.sun.star.beans.PropertyState)DIRECT_VALUE }, (com.sun.star.beans.PropertyValue){ Name = (string)"Overwrite", Handle = (long)0x0, Value = (any){ (boolean)true }, State = (com.sun.star.beans.PropertyState)DIRECT_VALUE }, (com.sun.star.beans.PropertyValue){ Name = (string)"OutputStream", Handle = (long)0x0, Value = (any){ (com.sun.star.uno.XInterface)0x2695ef8{, supportedInterfaces={com.sun.star.io.XOutputStream,com.sun.star.lang.XTypeProvider}} }, State = (com.sun.star.beans.PropertyState)DIRECT_VALUE })

What should I do?


回答1:


This seems to be an unfortunate bug in Unoconv. In the meantime, I seem to have found a workaround:

unoconv Test_Data.xlsx # converts to PDF by default
unoconv -f png Test_Data.pdf # *then* converts to PNG

From what I can tell from a quick Google search, this seems to be an issue with either LibreOffice or Python versions. If my workaround isn't viable for you, it's worth a try playing around with versions.




回答2:


I was little bit unfortunate while using Ubunutu 12.x server. It has builtin libreoffice. I tried to install openoffice through debian installer from open office site. But it wasn't able to convert any type of file.

So I removed everything by executing following commands.

sudo apt-get remove --purge libreoffice* libexttextcat-data* && sudo apt-get autoremove
sudo apt-get purge openoffice*.* && sudo apt-get autoremove
sudo apt-get remove --purge unoconv

Then Add libreoffice repository

sudo add-apt-repository ppa:libreoffice/libreoffice-4-2
sudo apt-get update
sudo apt-get dist-upgrade

Then install libreoffice and unoconv (apt-get version wasn't executing so I used git clone)

sudo apt-get install libreoffice
git clone https://github.com/dagwieers/unoconv
cd unoconv && sudo make install

These steps resolve my issues but I am still not able to convert docx or and xlsx to image :(. Where as from xlsx to pdf to image is working.




回答3:


Yes. Convert xlsx to html triggers this error. But xlsx to pdf doesn't



来源:https://stackoverflow.com/questions/23590960/unoconv-export-xlsx-file-into-image-like-png

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!