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

Free Support Forum - aspose.com

Powerpoint conversion to pdf giving malformed header

Good day,


I am running into a strange error where based on image content the pdf generated from a slide is malformed,

if I remove the images in the file attached and generate the pdf generated is completely fine,

however if I try to convert the document containing the images the pdf is malformed

in our software we are using the following method for this functionality

private void convertPptToPdf(InputStream is, OutputStream os) throws Exception {
Presentation pres = null;
log.debug(“Opening Stream”);
try {
pres = new Presentation(is);
} catch (Exception e) {
log.error(“Couldn’t open PowerPoint Document”);
throw e;
}
log.debug(“Saving”);
try {
pres.save(os, com.aspose.slides.SaveFormat.Pdf);
} catch(Exception e) {
log.error(“Couldn’t save PowerPoint Document to PDF”);
throw e;
}
log.debug(“PowerPoint conversion done”);
}





also on a side note, however not our main issue when doing bulk testing regarding enacting saves of these(literally just looping through and saving a few hundred), heap space errors will be thrown, only for slides containing these images, this does not occur every time, however has happened and can be replicated (a screenshot of the stack trace is also attached) this is thrown on the following line of code

log.debug(“Opening Stream”);
try {
pres = new Presentation(is);
} catch (Exception e) {
log.error(“Couldn’t open PowerPoint Document”);
throw e;
}
log.debug(“Saving”);
try {
pres.save(os, com.aspose.slides.SaveFormat.Pdf);
} catch(Exception e) {
log.error(“Couldn’t save PowerPoint Document to PDF”);
}


this issue occurs in aspose.slides-15.3.0-jdk16 as well as aspose.slides-15.9.0 for java

thank you

also users have reported saving of certain powerpoint files to take up to 9 minutes each(while large they are not ridiculously large, under 20 slides) any information on that would be wonderful as well, we have recreated this in seeing that instantiation of a “new Presentation(is)” for input stream directly coming from a file can take up to 5 minutes which seems strange and very inefficient, changing vmargs has no effect on this.


thank you

Hi Blake,

Thank you for posting.

I have observed your comments and worked with the file shared by you. I am unable to convert it to pdf as every time the OutOfMemoryError occurs. Please share with us the file which is being converted to pdf successfully and the file which are taking too long while saving them so that we may proceed further to help you out.

Best Regards,