Ask Your Question
0

Multiple instances for C# automation

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

anonymous user

Anonymous

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

anonymous user

Anonymous

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

delete close flag offensive retag edit

1 Answer

Sort by » oldest newest most voted
1

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

hunteke gravatar image hunteke
175 1 4 10

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.

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-10-29 22:11:45 +0200

Seen: 116 times

Last updated: Apr 06