【发布时间】:2012-10-15 09:37:48
【问题描述】:
我正在使用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 版本。但是从link 我了解到 Ubuntu 不久前切换到 libreoffice 而不是 openoffice。于是我通过以下命令安装了 libreoffice。
apt-get install libreoffice-core libreoffice-writer libreoffice-calc
但仍然遇到同样的错误。我缺少要安装的东西吗?有人对这个问题有任何想法吗?
【问题讨论】:
标签: shell ubuntu-12.04 libreoffice ubuntu-server