Ask Your Question
0

Multiple instances for C# automation [closed]

asked 2012-10-29 22:11:45 +0100

anonymous user

Anonymous

updated 2013-02-01 16:54:48 +0100

qubit gravatar image

Is it possible to open and handle multiple LibreOffice procsses and run conversions across all of them via C#?

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2015-10-28 03:00:59.141243

1 Answer

Sort by » oldest newest most voted
1

answered 2013-04-06 10:24:52 +0100

hunteke gravatar image

You've asked two questions.

  1. Is it possible to open and handle multiple LibO processes?

    I assume you mean concurrently, and the answer is yes. You can't, however, run the same profile concurrently. So, to open multiple LibO processes at the same time, you need to use a not-so-well-documented command line argument:

    $ libreoffice "-env:UserInstallation=file:///tmp/LibO_Process1" &
    $ libreoffice "-env:UserInstallation=file:///tmp/LibO_Process2" &
    

    This is Unix style syntax for the terminal, but the concept is the same for Windows. Run LibO and pass it the flag telling it to use a different configuration directory for each process. When each LibO completes, you may want to remove those configuration directories.

    Note that to connect to each of these instances, you'll need to further tell them to act as "servers" and accept incoming connections:

    $ libreoffice "-env:UserInstallation=file:///tmp/LibO_Process1" --accept="socket,port=10001;urp;" &
    $ libreoffice "-env:UserInstallation=file:///tmp/LibO_Process2" --accept="socket,port=10002;urp;" &
    [ ... ]
    

    Basically, assign each one a port through the UNO string to --accept.

  2. Does LibO have a C# API?

    I believe the answer is yes, though I have not used it myself. I just googled and the first page had a number of legitimate hits for how to do it, so I won't go into specifics. Short answer: yes.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2012-10-29 22:11:45 +0100

Seen: 1,649 times

Last updated: Apr 06 '13