PPTX to PDF conversion page format issue

Discuss the presentation application
Post Reply
poojard
Posts: 2
Joined: Thu Mar 30, 2017 2:00 pm

PPTX to PDF conversion page format issue

Post by poojard »

Hi,

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 open when I open sample pptx it's loading page with some cropped text. When I export it to pdf text also looks cropped in output pdf.
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.
Attachments
sample.pptx
(101.36 KiB) Downloaded 247 times
OpenOffice 2.4 on Ubuntu 9.04
User avatar
Mr.Dandy
Posts: 427
Joined: Tue Dec 11, 2012 4:22 pm

Re: PPTX to PDF conversion page format issue

Post by Mr.Dandy »

Install MS-Powerpoint free viewer and a PDF virtual printer like PDF Creator or DoPDF.
OpenOffice 4.1.12 - Windows 10
Post Reply