我正在使用unoconv
將不同的文件格式轉換爲pdf。它適用於所有格式的本地機器。但在我的Ubuntu 12.04服務器unoconv
是失敗的一些格式,如xls,ppt,pptx等。但它工作正常的文檔文件。它顯示了ppt轉換的以下錯誤。unoconv無法在Ubuntu 12.04服務器上工作
$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
但我仍然得到同樣的錯誤。我錯過了什麼安裝?有沒有人對這個問題有任何想法?
我發現這個優秀的博客(https://docs.moodle.org/31/en/Installing_unoconv)用於安裝和設置'unoconv'。 –