Invoking cli while an instance already runs.

Hi

I have written an xml filter (this page http://books.evc-cit.info/odbook/ch09.html has been very usefull).

I run the script whith the following command :

${SOFFICE} --invisible --infilter="Thomas" --convert-to odt input_file.xml

It works fine if no instance of libreoffice already runs.

But i have problems if one instance already runs :
  (1) the command hereabove returns without giving any results
  (2) if i run ${SOFFICE} --infilter="Thomas" input_file.xml, the document is open without using any filter (as xml)

Do you think it would be possible to run the command line conversion even if an instance of office already runs ?

Thank for your help.

Paul.

Hi :slight_smile:
I think that is one of the problems that created a need for this page
http://wiki.documentfoundation.org/Installing_in_parallel
Regards from
Tom :slight_smile:

I see that one of aims of this page is to explain how to have several versions running on parallel.

I would like to run in parallel one single installation.

Do you think i would only need to change the user directory (for example) for the cli run ?

Thank you for this informative page.

Regards.

Paul.

Hi :slight_smile:
I was wondering about that.  It would seem a bit kludgy but that might be the only way to do this right now.  I think a medium-term goal is to make it so that LO can run multiple instances alongside OpenOffice (and such) so it could become easier in a year or 2 but perhaps the kludge is the short-term answer?
Regards from
Tom :slight_smile:

May I ask you why you need to run two installations at the same time?

You can have 2 Writer documents open at the same time, in separate "windows".

So why need to install two copies of LibreOffice?

Hi Paul,

Paul Chavent schrieb:

I see that one of aims of this page is to explain how to have several
versions running on parallel.

I would like to run in parallel one single installation.

Try to use the start parameter -env:UserInstallation=. See help "Starting the LibreOffice Software From the Command Line".

Kind regards
Regina

I would like to be able to launch LO in command line to convert a doc while a instance is already running.

It seems to have two installations is the only way to do that !?

Thank you. I didn't notice this option with the -help switch.

With

soffice.bin -env:UserInstallation=~/.libreoffice_cli/ --headles --infilter="Thomas" --convert-to odt test.xml

The application cannot be started.
[context="shared"] caught unexpected exception!

Hi Paul,

Paul Chavent schrieb:

With

soffice.bin -env:UserInstallation=~/.libreoffice_cli/ --headles
--infilter="Thomas" --convert-to odt test.xml

The application cannot be started.
[context="shared"] caught unexpected exception!

It seems, that -env does not work from command line. I have tried it with a Windows desktop link (WinXP), and there it works.

I think, that you do not need --headless because that is automatically done in --convert-to.

This is a very special question. So you might get a skilled help on the developer mailinglist [1] or on developer IRC [2].
[1] libreoffice@lists.freedesktop.org
[2] irc://chat.freenode.net/libreoffice-dev

Kind regards
Regina

Thank Regina.

I will try on those other lists...

Paul Chavent <paul.chavent <at> fnac.net> writes:

Thank Regina.

I will try on those other lists...

> Hi Paul,
>
> Paul Chavent schrieb:
>> With
>>
>> soffice.bin -env:UserInstallation=~/.libreoffice_cli/ --headles
>> --infilter="Thomas" --convert-to odt test.xml
>>
>> The application cannot be started.
>> [context="shared"] caught unexpected exception!
>
> It seems, that -env does not work from command line. I have tried it with a

Windows desktop link (WinXP), and

there it works.
>
> I think, that you do not need --headless because that is automatically done

in --convert-to.

>
> This is a very special question. So you might get a skilled help on the

developer mailinglist [1] or on

developer IRC [2].
> [1] libreoffice <at> lists.freedesktop.org
> [2] irc://chat.freenode.net/libreoffice-dev
>
> Kind regards
> Regina
>
>

Paul, I am running Debian on a desktop computer. I generally have LibreOffice
running with one or more documents open. I also use a number of scripts that
take advantage of a separate headless isntance of LibreOffice to convert files
to pdf and other formats.

What I did was to make a copy of the ~/.libreoffice directory, calling it
something line ~/.libreoffice-cli. The normal working instance of LibreOffice
will use the ~/.libreoffice environment. The script will use the
~/.libreoffice-cli environment with the following system call:

"soffice --headless -env:UserInstallation=file:///home/[USER]/.libreoffice-cli/
-convert-to pdf -outdir /tmp [FILENAME]"

I don't know if there is a better way, but this works flawlessly for me. I hope
it helps you.