We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Generate PDF incorrectly from PPT and PPTX

Hi Everyone,


I’m using temp licence to convert ppt, pptx to pdf, I use code below:

com.aspose.slides.License newjavalic = new com.aspose.slides.License();
newjavalic.setLicense(new FileInputStream(licenseFile));
Presentation pres = new Presentation(“Performance_Out.pptx”);
pres.save(“Performance_Out.pdf”, com.aspose.slides.SaveFormat.Pdf);
After convert from pptx to pdf file, texts is disappeared. There is only image display in TomCat on Linux (Windows is OK) please review the attached files. please help me

thanks,
Phuc

Hi Phuc,

Thanks for your inquiry.
Your query is related to Aspose.Slides. I am moving this forum thread to
Aspose.Slides forum. My colleagues from Aspose.Slides team will reply you
asap.

Hi Phuc,


I have observed the issue statement shared by you. However, I am unable to download the presentation in attachments. Can you please share the sample presentation again. Before that I also request you to please test as Aspose.Slides for Java 15.6.0 on your first as well. Please share the feedback so that I may help you further in this regard.

Many Thanks,

Hi Mudassir,


I have just updated attached files, I’m using Aspose.Slides for Java 15.6.0. It works well on Windows, but missing text on Linux. please help me to check it again.

thanks,
Phuc

Hi Mudassir,


I have resolved above problem after install fonts(SimSun,Times New Roman,Calibri), problem is missed fonts.

thanks for your support,
Phuc

Hi Phuc,

Its good to know that installation of missing fonts have rectified the issue on your end. Please share if I may help you any further in this regard.

Many Thanks,

Hi Mudassi,


Currently conversion works well, but there are some minus issues, for example, if a slide has a lot of texts, some text will be overwriten, I think it is bug. I attached PPTX file and PDF file, PDF file is file after conversion. it happened on slide 14.
Please check it again.
Thanks,
Phuc

Hi Phuc,

I have worked with the presentation file using Aspose.Slides for Java 15.6.0 on my end and have created the PDF. There is no issue in generated PDF on my end. I request you to please try using the shared version and installing the fonts used in presentation on your end. I am hopeful that this will resolve the issue on your end.

Many Thanks,

Hi Mudassir,


I’m using fonts (Arial,Courier New), Aspose-slide-15.6.0, JDK 1.7.0.79
I found out problem, if I convert from ppt to pdf, it’s ok, but in my case, after convert to pdf to compress pdf file, it is the root cause for above error. below is my function to compress pdf file

private void compressPDF(final File pdfFile) throws Exception {
com.aspose.pdf.License newjavalic = new com.aspose.pdf.License();
newjavalic.setLicense(new FileInputStream(licenseFile));
Document doc = new Document(pdfFile.getAbsolutePath());
doc.optimizeResources();
doc.save(pdfFile.getAbsolutePath());
}
please check it again.
Thanks,
Phuc

Hi Phuc,


I have observed the code sample shared by you and the issue occurs when you compress the Aspose.Slides generated PDF using Aspose.Pdf. I will request my fellow team member from Aspose.Pdf team to share the feedback in this regard shortly.

Many Thanks,
phuctran:
Hi Mudassir,

I'm using fonts (Arial,Courier New), Aspose-slide-15.6.0, JDK 1.7.0.79
I found out problem, if I convert from ppt to pdf, it's ok, but in my case, after convert to pdf to compress pdf file, it is the root cause for above error. below is my function to compress pdf file

private void compressPDF(final File pdfFile) throws Exception {
com.aspose.pdf.License newjavalic = new com.aspose.pdf.License();
newjavalic.setLicense(new FileInputStream(licenseFile));
Document doc = new Document(pdfFile.getAbsolutePath());
doc.optimizeResources();
doc.save(pdfFile.getAbsolutePath());
}
please check it again.
Hi Phuc,

I have tested the scenario of PDF file optimization using Aspose.Pdf for Java 10.6.1 in Eclipse Juno application running over Windows 7 (x64) with JDK 1.7 and I am unable to notice any issue. For your reference, I have also attached the PDF file generated over my end.

BTW, for testing purposes/input file, I have used the PDF file shared by Mudassir in earlier post.

hi Nayyer,


I’m using aspose-pdf-10.6.1 for Java, Eclipse mars JDK 1.7.0.79
please recheck.
thank,
phuc

Hi Phuc,


I am also using similar versions of API and JDK and have tested it over Windows. Can you please confirm if you are also facing issue while using the API over Windows or you are using different OS.

Hi Nayyer,


I got the same problem on both Linux and Windows 10 pro. Below is my full codes, I hope it will be useful for you:

//Convert to PDF
com.aspose.slides.License newjavalic = new com.aspose.slides.License();
newjavalic.setLicense(new FileInputStream(licenseFile));
Presentation pres = new Presentation(“Performance_Out.pptx”)
pres.save(“Performance_Out.pdf”), com.aspose.slides.SaveFormat.Pdf);

//Compress PDF
com.aspose.pdf.License newjavalic = new com.aspose.pdf.License();
newjavalic.setLicense(new FileInputStream(licenseFile));
Document doc = new Document(“Performance_Out.pdf”);
doc.optimizeResources();
doc.save(“pdfFile.getAbsolutePath()”);

Regards,
Phuc Tran

Hi Phuc,


Thanks for sharing the details.

We have tested the scenario over Ubuntu Linux and we are unable to notice any issue. Meanwhile we are testing the scenario over Windows 10 and will keep you posted with our findings.

Hi Phuc,


Thanks for your patience.

I have again tested the scenario on Windows 10 (x64) with JDK 1.8 and I am unable to notice any issue. Once the PDF optimization code is executed, no contents are removed from file. For your reference, I have also attached the output generated using Aspose.Pdf for Java 10.8.0.

thank you for your verification, I verified and I found out when I run conversion as stand alone application, conversion works ok, but when we integrated it with our mobility app, I got above error. I have no time to investigate this issue, because it only appear with powerpoint file several text.

Hi Phuc,


Thanks for the acknowledgement.

We also tested the scenario in a stand alone application. However please share some details regarding your environment which can help us in replicating it in our environment. We are really sorry for this inconvenience.