Am Freitag, den 20.04.2007, 15:18 -0700 schrieb Ryan Grimm: > > I'm working on exporting spreadsheet documents to pdf using Java. I can > > get the documents exported as a pdf without any problem, but I'd like to > > change the paper size so the pagination is a bit nicer. Even when I set > > the size, the document still comes out as being 8.5x11. > > Anyone have any thoughts on how to do this? I've continued to try and > work through things myself but haven't gotten anywhere. > > I've tried to boil down my code as much as I can: > > XStyleFamiliesSupplier xSupplier = (XStyleFamiliesSupplier) > UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, > xSpreadsheetDocument); > > XNameAccess xNameAccess = xSupplier.getStyleFamilies(); > XNameContainer xPageStyleCollection = (XNameContainer) > UnoRuntime.queryInterface(XNameContainer.class, > xNameAccess.getByName("PageStyles")); > > XPropertySet xPropertySet = (XPropertySet) > UnoRuntime.queryInterface(XPropertySet.class, > xPageStyleCollection.getByName("Default")); > > Size large = new Size(50000, 50000); > xPropertySet.setPropertyValue("Size", large);
If this last step doesn't work, the easiest way to get around would be to predefine a new page style having the size set as needed. In your program you would only apply this page style temporarily and reset after it is done - no need to fiddle with actual sizes directly. If you have only one or a small amount of special size settings you only need to care about distributing the page style to every client ... HTH, Marc --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]