unoconv not working on ubuntu 12.04 server

Jinesh picture Jinesh · Oct 25, 2012 · Viewed 10.2k times · Source

I am using unoconv to convert different file formats to pdf. It is working well on my local machine for all formats. But on my ubuntu 12.04 server unoconv is failing for some formats such as xls, ppt, pptx etc. However it is working fine for doc files. It shows the following error for the ppt conversion.

$unoconv -f pdf Googling.ppt 
unoconv: UnoException during conversion in <class '__main__.com.sun.star.lang.IllegalArgumentException'>: Unsupported URL <file:///home/pythonuser/almamapper/media/library/files/c1cb92e62ce54b29a017a6e8eaa23c/Googling.ppt>: ""
Traceback (most recent call last):
File "/usr/bin/unoconv", line 790, in <module>
main()
File "/usr/bin/unoconv", line 769, in main
convertor.convert(inputfn)
File "/usr/bin/unoconv", line 679, in convert
error("ERROR: The provided document cannot be converted to the desired format. (code: %s)" % e.ErrCode)
File "/usr/lib/python2.7/dist-packages/uno.py", line 337, in _uno_struct__getattr__
return __builtin__.getattr(self.__dict__["value"],name)
AttributeError: ErrCode

I know I have to install openoffice-headless version on my server. But from this link I understand that Ubuntu switched to libreoffice instead of openoffice quite a while ago. So I installed libreoffice by the following command.

apt-get install libreoffice-core libreoffice-writer libreoffice-calc

But still am getting the same error. Am I missing something to install? Do anyone have any thoughts on this issue?

Answer

Jinesh picture Jinesh · Oct 25, 2012

I fixed the above issue by installing latest version of unoconv. I tried updating libreoffice and installing complete version, neither helped.

I was using unoconv 0.3, and the latest available version is 0.6. So I installed the latest one and it solved the issue.

Here is the steps i followed:

  1. apt-get remove --purge unoconv (remove the old unoconv first)
  2. git clone https://github.com/dagwieers/unoconv (download latest version of unoconv from github.)

  3. now cd to unoconv directory and do sudo make install

Note: pls do git clone, dont download the tar file. In my case the installation failed when I downloaded the tar.