10

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?

Community
  • 1
  • 1
Jinesh
  • 2,507
  • 2
  • 22
  • 23

2 Answers2

18

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.

Jinesh
  • 2,507
  • 2
  • 22
  • 23
  • 1
    I found this excellent blog (https://docs.moodle.org/31/en/Installing_unoconv) for installing and setting up `unoconv`. – Yogesh Khater Oct 05 '16 at 13:23
8

I had the same general problem after doing apt-get install unoconv, an additional apt-get install libreoffice fixed it. Probably your limited install of only some libreoffice components is the reason it only works for some formats. Certainly I would expect it to need libreoffice-impress for ppt conversion?

  • I tried that too. And at the end I resolved it by installing latest version of `unoconv`. Answer given below. Thanks for suggestion. – Jinesh Oct 25 '12 at 13:16
  • 9
    I had the issue for doc conversion (`-f doc`) with `unoconv`. And I could indeed solve the issue after a `apt-get install libreoffice-writer`, thanks @HermanHiddema. But I also needed to kill the running soffice process `killall soffice.bin` otherwise it didn't work. – Andre Miras Feb 03 '13 at 18:02
  • 1
    @AndreMiras this is also the case when trying to run this on an Ubuntu Desktop. I develop against a 12.04 desktop environment and deploy against a 12.04 server. If you have a document open in LibreOffice and you try to convert a document at the command line, the conversion will silently fail. – chucksmash Mar 28 '13 at 21:19
  • @AndreMiras, Thanks for saving the day by mentioning ````killall soffice.bin````. I was wondering why I wasn't getting the result. – Himel Nag Rana Apr 13 '15 at 06:55