OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Closing a document without doing a .dispose (C#, CLI)

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
Gravel
Newbie
Newbie


Joined: 23 Feb 2006
Posts: 1

PostPosted: Mon Feb 27, 2006 11:12 am    Post subject: Closing a document without doing a .dispose (C#, CLI) Reply with quote

I have customised LarsB's example of a command line PDF converter.
http://www.oooforum.org/forum/viewtopic.phtml?t=29198&highlight=converting+pdf

Basically I've created a .NET assembly written in C# which performs the same logic but also does some other custom file stuff.

I load this assembly from a .NET service which will read from a MSMQ queue. Upon receiving a message it will convert a .DOC to a .PDF file and reply to the calling application with status etc...

The file conversions need to be fast and I need to keep OpenOffice open and keep the objects loaded in memory.

Now to my question:

How can I just close the document programatically without calling a .dispose on the XComponent?

Thanks in advance for any input.
Back to top
View user's profile Send private message
LarsB
OOo Advocate
OOo Advocate


Joined: 31 Aug 2005
Posts: 445
Location: Hamburg, Germany

PostPosted: Tue Feb 28, 2006 12:00 am    Post subject: What's wrong with dispose Reply with quote

Hi,

what's wrong with the dispose method? If you start your conversation first
the OpenOffice process will be started, and even if you close resp. dispose
the converted document the process won't be killed and the next start
will be much more faster then the first one. So in sum, you only lost some
execution time during the first start. Or do you need this bevahior anyway?
If yes, you could load the document into the existing current frame. OpenOffice
will then don't shut down, it will only close the current document and load
the new one into the existing frame. If this an option for you. You should give
your frame unique names and call the loadComponentFroUrl with this frame
as target frame. See the description of loadComponentFromUrl details.

Hope this help you out.

Cheers,
LarsB
_________________
AODC - A free OpenDocument Converter
AODL - An independent OpenDocument Library C#
EmbeddedOpenOffice .net UserControl C#
EmbeddedOpenOffice Visual Studio .net Add In

http://www.OpenDocument4all.com/
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group