Hi Andreas,

>> So I can set a print option of "Wait" to "true" and my program will
>> wait until the document is printed?  Do I understand that properly? 
>> That would simplify several questions I've had along the way.
> 
> It makes your XPrintable.print() call synchron !
> If your call returns the document was printed (at least the content
> was transfered completely to the underlying print queue of your system).
> That means you can close the document afterwards without any problems
> and you can shutdown the whole office without any problems.

pretty cool your tip! Hal, I implemented it and tested it and I can
share the easy code with you:
-----%<-----
// Querying for the interface XPrintable on the loaded document
XPrintable xPrintable = (XPrintable)
        UnoRuntime.queryInterface(XPrintable.class, this.xComponent);

// Making the print job syncronous. Thus the program continues after
// printing is finished. A print job listener is not needed.
PropertyValue[] printOpts = new PropertyValue[1];
printOpts[1] = new PropertyValue();
printOpts[1].Name = "Wait";
printOpts[1].Value = new Boolean(true);
                
try {
        xPrintable.print(printOpts);
} catch (IllegalArgumentException e) {
        e.printStackTrace();
}
-----%<-----

Thanks Andreas for your tip!

Greetings, Tobias

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

Reply via email to