Ask Your Question
0

How to NOT connect to a running instance

asked 2012-04-04 02:51:01 +0200

jimav gravatar image jimav
21 1 1 3

I want to convert files from a script using command line options, for example:

   libreoffice --headless --invisible --convert-to csv file.xls

This works only if Libre Office is not currently running interactively.

For example, if localc was run (on an unrelated document), then the above shell command silently fails to have any effect.

I suspect the command connects to the pre-existing interactive instance. How can I prevent this, forcing the command to use an independently started instance?

(or any other way to make the command work reliably, whether or not LO is already running)

delete close flag offensive retag edit

1 Answer

Sort by » oldest newest most voted
2

answered 2012-04-04 20:39:39 +0200

hunteke gravatar image hunteke
175 4 10

updated 2012-07-14 07:55:23 +0200

This is unfortunately not directly possible thanks to Bug #37531.

The workaround is to run LibO with another profile. From that bug report then, comment 25 suggests using the not-so-well documented -env flag:

    libreoffice "-env:UserInstallation=file:///tmp/LibO_Conversion" --headless --invisible --convert-to csv file.xls

If security is a concern, note that LibO creates that directory with user-only permissions, and you can similarly tack on an rm (or the appropriate operating system variant) command:

    libreoffice [...] ; rm -rf /tmp/LibO_Conversion
link delete flag offensive edit

Login/Signup to Answer

Donate

LibreOffice is made available by volunteers around the globe, backed by a charitable Foundation. Please support our efforts: Your donation helps us to deliver a better product!

Question tools

Follow
1 follower

subscribe to rss feed

Stats

Asked: 2012-04-04 02:51:01 +0200

Seen: 739 times

Last updated: Jul 14 '12