Hal Vaughan wrote:

> Another upgrade question:
> 
> I have a point in my Java program where I print out a lot of files in a
> directory.  It would be nice to speed this process up as quickly as possible.
> With OOo 1.x, I found I had problems if I didn't add a print listener.
> Basically I'd do this:
> 
> Loop
>       Find Next File
>       Open doc From File
>       Print Doc
>       Wait on Listener Until Doc is Printed
>       Close Doc
>       Delete File
> End Loop
> 
> I found that if I did NOT include the step to wait on the listener, I'd have
> problems in the long run.  What is the status now?  Should I be able to close
> a doc immediately after printing it, or will that cause problems I might not
> learn about until I'm showing off my new program in front of a client and
> something strange happens at just the wrong time?

You should be able to close the document immediately by calling
close(true) on it. The document will refuse to be closed if the printing
process is still ongoing (by throwing an exception) but it will
automatically close itself as soon as the printing is done (if you have
used "true" as an argument in the close call).

I'm not sure what will happen if you close the whole application while a
printing is ongoing (never tested this). In case you don't need to do
this and if you also don't need to stay operable with OOo1 you can try
to drop the waiting.

Ciao,
Mathias

-- 
Mathias Bauer - OpenOffice.org Application Framework Project Lead
Please reply to the list only, [EMAIL PROTECTED] is a spam sink.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to