I am using libreoffice under CentOS 6. I can convert ODT files to PDF with:
libreoffice --headless --convert-to pdf *.odt
but the problem is that it only works when no document is open in libreoffice.
When I specify --env:UserInstallation=file:///path/to/some/directory
as suggested in one of the comments of this question , it doesn't help.
What am I doing wrong? It is a nuisance to close all libreoffice instances before running the before command.
Best Answer
That is unlikely going to work, as the suggestion in the comment is both incomplete (you cannot just specify some directory) and incorrect (
--env:...
should be-env:..
. Here is what I recommend you do:Start libreoffice from the commandline without specifying
--headless
:you should replace
/home/username
with your home directory (and adjust.config
if you don't have that on your CentOS, I did this on Ubuntu and Linux Mint). The above will create a new configuration directory for the alternate libreoffice in your .config directory, without which you would get some error about java not being found./home/username/.config/libreoffice-alt
should now have been created for you.Now start another
libreoffice
from the command-line (doing so allows you to see some useful messages if things go wrong when starting the second instance), without the-env:...
, and while that is still running start the conversion using: