On Monday 09 January 2006 01:12 pm, Mathias Bauer wrote: > 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.
I've pretty much decided to kill 1.x compatibility. I don't want to deal with issues when a client downloads 2.x and saves a .odt file and wonders why it doesn't work with his system that still uses 1.x. It's too hard to educate users on different file types and easier to just get all my existing clients to update (at least in my case). I don't need to close the app, but that is an interesting point. As of now, it's all working and I believe in the old addage, "If it ain't broke, don't fix it." I'd like to remove the listener, but then I need to change one or two other things that track open documents, and as long as this is working well, I don't think I'm going to touch it until I have free time (that's something I heard some people have) and can test it extensively. Thanks for the info, Mathias! Hal --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
