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

XStorable xStorable = (XStorable)
    UnoRuntime.queryInterface(XStorable.class, xComponent);

PropertyValue[] storeProps = new PropertyValue[1];
storeProps[0] = new PropertyValue();
storeProps[0].Name = "FilterName";
storeProps[0].Value = "calc_pdf_Export";

xStorable.storeToURL("file://" + outFile, storeProps);


--Ryan

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

Reply via email to