Ask Your Question
1

How can I use soffice from the command line when Quickstarter is running? [closed]

asked 2013-03-19 15:36:23 +0200

Phitherek_ gravatar image

updated 2014-02-12 00:10:44 +0200

bencomp gravatar image

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?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2016-02-19 09:57:21.391406

2 Answers

Sort by » oldest newest most voted
0

answered 2013-03-20 10:17:02 +0200

qubit gravatar image

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.

edit flag offensive delete link more

Comments

@Phitherek_ -- Did my Answer solve your question? If so, please mark it as correct!

qubit gravatar imagequbit ( 2013-04-08 09:36:26 +0200 )edit

@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.

Kurt Pfeifle gravatar imageKurt Pfeifle ( 2014-02-11 23:25:32 +0200 )edit
1

answered 2014-02-11 23:23:19 +0200

Kurt Pfeifle gravatar image

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.

edit flag offensive delete link more

Comments

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.

Hi-Angel gravatar imageHi-Angel ( 2015-08-09 13:03:41 +0200 )edit

It did work perfectly when I try on Linux.

LibO_udir=$(mktemp /tmp/LibO_udir_XXXX)
libreoffice -env:UserInstallation=file://$LibO_udir --headless ....
PBI gravatar imagePBI ( 2016-03-10 12:33:34 +0200 )edit

Question Tools

Stats

Asked: 2013-03-19 15:36:23 +0200

Seen: 5,106 times

Last updated: Feb 12 '14