我正在使用unoconv
将不同的文件格式转换为PDF。在我的本地计算机上,它能够很好地处理所有的格式。但是在我的Ubuntu 12.04服务器上,unoconv
无法处理一些格式,例如xls、ppt、pptx等。然而,对于doc文件,它可以正常工作。对于PPT转换,它显示以下错误:
$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
我知道我需要在我的服务器上安装openoffice-headless版本。但是从这个链接中我了解到Ubuntu已经相当长的一段时间前转向了libreoffice而不是openoffice。 因此,我通过以下命令安装了libreoffice。
apt-get install libreoffice-core libreoffice-writer libreoffice-calc
但我仍然遇到同样的错误。 我少装了些什么吗? 有没有人对此问题有任何想法?
unoconv
。 - Yogesh Khater