To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=72246
                 Issue #|72246
                 Summary|Setting printer tray on Presentations / Drawings via A
                        |PI not possible
               Component|api
                 Version|OOo 2.0.4
                Platform|All
                     URL|
              OS/Version|All
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|ENHANCEMENT
                Priority|P4
            Subcomponent|code
             Assigned to|jsc
             Reported by|tobiaskrais





------- Additional comments from [EMAIL PROTECTED] Mon Dec  4 02:21:06 -0800 
2006 -------
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

---------------------------------------------------------------------
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