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

Free Support Forum - aspose.com

PDF conversion broken. Nullpointer when converting any PPTX to PDF

Hi,

when I try to convert a PPTX to PDF using the following code I get a Nullpointer Exception.




PresentationEx presentation = new PresentationEx(pptxBytes);
ByteArrayOutputStream pdfBytes = new ByteArrayOutputStream();
PdfOptions opt = new PdfOptions();
opt.setJpegQuality(90);

//Define behavior for metafiles
opt.setSaveMetafilesAsPng(true);
//Set Text Compression level
opt.setTextCompression(com.aspose.slides.export.PdfTextCompression.FLATE);

//Define the PDF standard
opt.setCompliance(com.aspose.slides.export.PdfCompliance.PDF_15);
// here we would have the possibility to specify PDF options…
presentation.save(pdfBytes, SaveFormat.PDF, opt);

The stacktrace is:

java.lang.NullPointerException at com.aspose.slides.obfuscated.egv.if(SourceFile:1025) at com.aspose.slides.obfuscated.egv.do(SourceFile:999) at com.aspose.slides.obfuscated.egv.if(SourceFile:218) at com.aspose.slides.pptx.PresentationEx.do(Unknown Source) at com.aspose.slides.pptx.PresentationEx.(Unknown Source) at com.aspose.slides.pptx.PresentationEx.(Unknown Source)



I’m using Aspose.Slides version 2.9.1. This is a real project blocker for us, as we are not able to produce PDF anymore…

Thank you for fast help

Marco

Hi Marco,


I have observed the stack trace shared by you. Please share the source presentation with us for further investigation on our end.

Many Thanks,

hi Mudassir,

Thank you for the fast response. Actually this was my error. The inputstream was null. Sorry for the inconvenience.

You can close this thread.

Regards
Marco