Issue 72246 - Setting printer tray on Presentations / Drawings via API not possible
Summary: Setting printer tray on Presentations / Drawings via API not possible
Status: CLOSED NOT_AN_OOO_ISSUE
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P4 Trivial
Target Milestone: ---
Assignee: clippka
QA Contact: issues@api
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-04 10:21 UTC by tobiaskrais
Modified: 2013-02-24 21:08 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description tobiaskrais 2006-12-04 10:21:06 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
Comment 1 jsc 2006-12-04 10:32:38 UTC
jsc -> cl: can you check this request for enhancement please
Comment 2 clippka 2007-01-02 07:47:14 UTC
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.
Comment 3 clippka 2007-01-02 07:47:38 UTC
closing issue