To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=87495





------- Additional comments from [email protected] Fri Jan 16 17:25:03 +0000 
2009 -------
After having a closer look on the implementation in VCL it seems that it treats
the "PaperBin" as a property of the printer and not as a print option.

So consequently we should treat it the same in the API:

// Querying for the interface XPrintable on the loaded document
XPrintable xPrintable = (XPrintable)
        UnoRuntime.queryInterface(XPrintable.class, this.xComponent);

// Setting the property "Name" for the favoured printer
PropertyValue[] printerDesc = new PropertyValue[2];
printerDesc[0] = new PropertyValue();
printerDesc[0].Name = "Name";
printerDesc[0].Value = printerName;
printerDesc[1] = new PropertyValue();
printerDesc[1].Name = "PrinterPaperTray";
printerDesc[1].Value = "Cassette 1";

try {
        // Setting the name of the printer
        xPrintable.setPrinter(printerDesc);
} catch (IllegalArgumentException ignore) {}
        
// Setting the property "Pages" so that only the desired pages
// will be printed.
PropertyValue[] printOpts = new PropertyValue[1];
printOpts[0] = new PropertyValue();
printOpts[0].Name = "Pages";
printOpts[0].Value = myPages;
                
try {
        xPrintable.print(printOpts);
} catch (IllegalArgumentException ignore) {}

If we didn't do that, the PrintOption would modify the internal Printer instance
(and so the next print job would go to the same tray even if not asked for) and
this is an unwanted side effect.

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to