LibreOffice Command Line Conversion - No Output File?

我的未来我决定 提交于 2019-12-20 05:03:23

问题


I am using LibreOffice installed on my Linux box and I seem to be having a weird problem in that the conversion seems to be taking place, and there seem to be no errors, but there is no output file in the specified output directory.

Here is an example of the command I am using:

/opt/libreoffice3.6/program/soffice --headless --invisible --convert-to pdf /dir/file.pptx --outdir /dir

And here is the result of that command:

convert /dir/file.pptx -> /dir/file.pdf using impress_pdf_Export

But the problem is that after running the conversion /dir/file.pdf does not exist.

Do any of you have any suggestions?


回答1:


I cant reproduce your error. It works for me, even with pptx files.

Check the bug-tracker of libreoffice. Try another version (I am still running 3.4.something). Investigate the output directory - e.g. do you have write privileges there?

And a rather stupid idea: Hit F5 (or similar) in your file browser (mine is Dolphin) in order to refresh. I needed to do this in this case, so I could see the new file.




回答2:


If you see no output then the problem may be related to this bug. Just make sure that there is no other instance of libre office running (soffice.bin). Source.




回答3:


I had a similar problem where soffice seemed to run fine (headless mode on server) but there were no output files.

Fixed it by running apt-get install libreoffice-writer




回答4:


Go to the folder your file is in & convert it to that location to see if your conversion works. If it works, try to put "" around your file to convert.

I have a bashscript that you can maybe use for your problem:

#!/bin/bash

# first do chmod +x convert.sh
# then run ./convert.sh

mkdir out
cd testfiles
for file in *; do
    echo "${file}"
    soffice --headless -convert-to pdf:"writer_pdf_Export"      
        --outdir ../Documenten/BLACK/out "${file}" 
done
cd ..


来源:https://stackoverflow.com/questions/13734542/libreoffice-command-line-conversion-no-output-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!