Hi,

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.

Any pointers to what I'm doing wrong here would be appreciated.

XComponent xComponent = xComponentLoader.loadComponentFromURL(
    "file://" + inputFile , "_blank", 0, loadProps);

XSpreadsheetDocument xSpreadsheetDocument = (XSpreadsheetDocument)
    UnoRuntime.queryInterface(XSpreadsheetDocument.class, xComponent);

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

xComponent.dispose();


Thanks.

--Ryan

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

Reply via email to