I’m generating a frame like so:
XTextFrame frame = UnoRuntime.queryInterface(XTextFrame.class, serviceFactory.createInstance("com.sun.star.text.TextFrame"));
text.insertTextContent(cursor, frame, false);
XPropertySet properties = UnoRuntime.queryInterface(XPropertySet.class, frame);
properties.setPropertyValue("AnchorType", TextContentAnchorType.AT_PAGE);
properties.setPropertyValue("VertOrient", VertOrientation.CENTER);
properties.setPropertyValue("VertOrientRelation", RelOrientation.PRINT_AREA);
properties.setPropertyValue("HoriOrient", HoriOrientation.CENTER);
properties.setPropertyValue("HoriOrientRelation", RelOrientation.PRINT_AREA);
properties.setPropertyValue("Width", 15000);
// properties.setPropertyValue("RelativeWidthRelation", RelOrientation.PRINT_AREA);
// properties.setPropertyValue("RelativeWidth", 100);
If I comment out the “Width” setting line and uncomment the relative width setting lines, the frame shows up as 1 character wide. I’ve tried all the different RelOrientation values but none of them make any difference. What do I need to do to get the frame sized as 100% of the printable area on the page?