Hello,
I usually have a running instance of LO in the background (the QuickStart icon). I tried to create a script that automatically converts a presentation to the PDF document. However, the command line for soffice does not work until I close this instance. How can I solve this?
To start more than one instance of LibreOffice, you need to assign each instance its own environment. For this, use -env:UserInstallation=file:///path/to/directory
.
In order to convert an ODS spreadsheet file on the commandline (on a Mac) while a GUI instance of LO is running, I use this command:
/Applications/LibreOffice.app/Contents/MacOS/soffice \
"-env:UserInstallation=file:///tmp/LibO_Conversion__${USER}" \
--headless \
--convert-to pdf:calc_pdf_Export \
--outdir $(pwd)/lo \
$(pwd)/lh-dummy.ods
After completing the command, you may delete /tmp/LibO_Conversion__${USER}
again.
Doesn’t work, it either complains I/O error : Is a directory
, then if I create an empty file, it says parser error : Document is empty
.
It did work perfectly when I try on Linux.
LibO_udir=$(mktemp /tmp/LibO_udir_XXXX)
libreoffice -env:UserInstallation=file://$LibO_udir --headless ....
Hi @Phitherek,
I’m not sure it’s currently possible to run two copies of the same install of LibreOffice at the same time. You could try to install two copies of LibreOffice side-by-side and use one with the quickstarter and one just for command-line conversion.
@qbit: You can be sure now. It IS possible to run multiple instances of LibreOffice, as long as you add a uniq -env:UserInstallation=file:///some/dir/xyz
commandline parameter when starting each instance.