I am using open office to convert pptx to pdf using export to pdf functionality.Below is the code -
Code: Select all
XComponentLoader xComponentLoader = OpenOfficeConnector.getOpenOfficeLoader();
PropertyValue[] loadProps = new PropertyValue[1];
loadProps[0] = new PropertyValue();
loadProps[0].Name = "Hidden";
loadProps[0].Value = Boolean.TRUE;
PropertyValue[] storeProps = new PropertyValue[1];
storeProps[0] = new PropertyValue();
storeProps[0].Name = "FilterName";
storeProps[0].Value = "impress_pdf_Export";
source = "file:///".concat(source);
destination="file:///".concat(destination);
XComponent document = xComponentLoader.loadComponentFromURL(source, "_default", 0, loadProps);
XStorable xStorable = UnoRuntime.queryInterface(XStorable.class, document);
xStorable.storeToURL(destination, storeProps);
XCloseable xcloseable = UnoRuntime.queryInterface(XCloseable.class, document);
xcloseable.close(false);
When I go to Format->Page-> and change it to A3 it shows the correct text and then in export pdf it looks fine.
I want to either change page size on document load using java code or please suggest any other alternative if there.
This is very urgent issue please help me solve this.
Attaching sample file pptx.