开发者

How do I run OpenOffice.org as a background process for connecting my application to using the UNO Java API?

开发者 https://www.devze.com 2023-04-06 16:28 出处:网络
Right now, I\'m starting OpenOffice.org 3.3 with the arguments \"-accept=socket,host=0,port=8100;urp;\" using a shell script (.bat file on Windows, .sh file on Solaris). OpenOffice.org starts and the

Right now, I'm starting OpenOffice.org 3.3 with the arguments "-accept=socket,host=0,port=8100;urp;" using a shell script (.bat file on Windows, .sh file on Solaris). OpenOffice.org starts and the main screen appears (the one where you can select a document type, open a template, or open a file). Eventually, this screen will be disabled, though - I see there are arguments for that purpose.

After starting OpenOffice.org, I can launch my application and create my document with the UNO API libraries for Java. At this point, both the OpenOffice.org main menu screen and my document are open. However, when I close the document, the OpenOffice.org main menu screen also cl开发者_JS百科oses and the OpenOffice.org process terminates. If I use my application to generate another document, it is unable to connect (because the soffice process is no longer running).

My goal is to be able to start the process (or have it start with system startup, if the user configures it that way), have it sit until explicitly terminated, and contine accepting new generated documents.

How can I get the desired the desired behavior? Right now, my use case is that the soffice process is started from a shell script, however another use case is that soffice is configured to run on system startup. Is my behavior only possible with running the soffice process another way (as in on system startup, rather than executing via a batch script)? The only other option that I see (which I'm considering now) is to launch the OpenOffice.org process "on-demand" from my Java application, either start it from the Java application and terminate it when the Java application ends or launch the process every time I need to produce a new document.


You can add the parmeters -invisible and -headless to the commandline when starting soffice.exe.

That will hide the main window when OOo - very similar to a "service".

As far as I remember, opening a document will then not even display the OOo main window.

0

精彩评论

暂无评论...
验证码 换一张
取 消