Hi Kent,

Does anyone have an example of this in Java?

I cannot seem to be able to create a document where
one side uses a left sided style and the next page
uses the right sided style.

It ends up using for the whole document the last style
loaded with CursorProps.setPropertyValue(
"PageDescName", style ).

Then if I create a page break the editor generates
"Blank Pages"  which can only be seen in print preview
and say "blank page" over them.

the problem here might be the "FollowStyle" ... beu default this is "default" for "FirstPage", "Left Page" for "Left Page" and "Right Page" for "Right Page"

Something like

try {
        XStyleFamiliesSupplier xSFS = (XStyleFamiliesSupplier)
                UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xModel);
                
        XNameAccess xFamilies = xSFS.getStyleFamilies();
        
        XNameContainer xFamily = (XNameContainer)
                UnoRuntime.queryInterface(
                        XNameContainer.class, 
xFamilies.getByName("PageStyles"));
                        
        XStyle firstPageStyle = (XStyle)
                UnoRuntime.queryInterface(
                        XStyle.class, xFamily.getByName("First Page"));         
              
        XPropertySet xFirstStyleProps = (XPropertySet)
                UnoRuntime.queryInterface(XPropertySet.class, firstPageStyle);  
        
        xFirstStyleProps.setPropertyValue("FollowStyle", "Right Page");
        
        XStyle leftPageStyle = (XStyle)
                UnoRuntime.queryInterface(
                                XStyle.class, xFamily.getByName("Left Page"));
        XPropertySet xLeftStyleProps = (XPropertySet)
                        UnoRuntime.queryInterface(XPropertySet.class, 
leftPageStyle);
        xLeftStyleProps.setPropertyValue("FollowStyle", "Right Page");
        
        XStyle rightPageStyle = (XStyle)
                UnoRuntime.queryInterface(
                        XStyle.class, xFamily.getByName("Right Page"));
        XPropertySet xRightStyleProps = (XPropertySet)
                UnoRuntime.queryInterface(XPropertySet.class, rightPageStyle);
        xRightStyleProps.setPropertyValue("FollowStyle", "Left Page");
} catch (Exception e) {
        
}

should do that.

If you then set the property "PageDescName" of the Cursor gained by

XTextDocument.getText().createTextCursor()

to "First Page" you should have what you wanted.

Hope that helps

Regards

Stephan

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

Reply via email to