Apache OpenOffice (AOO) Bugzilla – Issue 72246
Setting printer tray on Presentations / Drawings via API not possible
Last modified: 2013-02-24 21:08:36 UTC
Hi, I would like to set the printer tray for a presentation and a drawing document. This code snippet (http://codesnippets.services.openoffice.org/Office/Office.PrintOnDifferentTrays.snip) shows how I do this with a XTextDocument. Very close to this code, I want to do following for a presentation document: -----%<----- // Get the Presentation document XPresentationSupplier xPresSupplier = (XPresentationSupplier) UnoRuntime.queryInterface(XPresentationSupplier.class, xComponent); // Get the StyleFamiliesSupplier interface of the document XStyleFamiliesSupplier xSupplier = (XStyleFamiliesSupplier) UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xPresSupplier); // Getting the page style name XPresentation xPresentation = xPresSupplier.getPresentation(); XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xPresentation); // TODO: Such a property name as needed does not exist... String pageStyleName = xPropSet.getPropertyValue("PageStyleName").toString(); ...continue... -----%<----- Please see the TODO line. My suggestion is to implement a XPropertySet named "PageStyleName". (Any other way to set the printer tray would be acceptable for me, too...). And here the same code for a drawing document: -----%<----- // Get the Drawing document XDrawPagesSupplier xDrawPagesSupplier = (XDrawPagesSupplier) UnoRuntime.queryInterface(XDrawPagesSupplier.class, xComponent); // Get the StyleFamiliesSupplier interface of the document XStyleFamiliesSupplier xSupplier = (XStyleFamiliesSupplier) UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xDrawPagesSupplier); // Get the page style name XDrawPages xDrawPages = xDrawPagesSupplier.getDrawPages(); for (int i = 0; i < xDrawPages.getCount(); i++) { XDrawPage xDrawPage = (XDrawPage) AnyConverter.toObject(XDrawPage.class, xDrawPages.getByIndex(i)); XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xDrawPage); // TODO: Such a property name as needed does not exist... String pageStyle = xPropSet.getPropertyValue("PageStyleName") .toString(); ...continue... } -----%<----- Please think about implementing this feature. Greetings, Tobias
jsc -> cl: can you check this request for enhancement please
There are no page styles in impress or draw, impress and draw use the concept of master pages. Besides that, there is no way to change printer settings for individual pages, only for the three different types of pages, namely slides, notes and handouts. Therefore I will not add a property PageStyleName to impress/draw, since this does not make any sense mainly because page styles are not supported.
closing issue