unoconv没有在ubuntu 12.04服务器上工作

Jin*_*esh 10 shell ubuntu-server libreoffice ubuntu-12.04

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
Run Code Online (Sandbox Code Playgroud)

我知道我必须在我的服务器上安装openoffice-headless版本.但是从这个链接我明白Ubuntu很久以前就改用了libreoffice而不是openoffice.所以我通过以下命令安装了libreoffice.

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

但仍然得到同样的错误.我错过了安装的东西吗?有没有人对这个问题有任何想法?

Jin*_*esh 18

我通过安装最新版本修复了上述问题unoconv.我尝试更新libreoffice并安装完整版本,但都没有帮助.

我正在使用unoconv 0.3,最新的版本是0.6.所以我安装了最新的一个,它解决了这个问题.

以下是我遵循的步骤:

  1. apt-get remove --purge unoconv (首先删除旧的unoconv)
  2. git clone https://github.com/dagwieers/unoconv (从github下载最新版本的unoconv.)

  3. 现在cd到unoconv目录并做 sudo make install

注意:请执行git clone,不要下载tar文件.在我的情况下,我下载tar时安装失败.


小智 8

在做完之后我有同样的一般问题apt-get install unoconv,另外一个apt-get install libreoffice固定它.可能只有一些libreoffice组件的有限安装是它仅适用于某些格式的原因.当然我希望它需要libreoffice-impressppt转换?

  • 我有'unoconv`的doc转换问题(`-f doc`).我确实可以在"apt-get install libreoffice-writer"之后解决这个问题,感谢@HermanHiddema.但我还需要杀死正在运行的soffice进程`killall soffice.bin`,否则它无法正常工作. (9认同)