Aspose.PDF is throwing Exception

Hi Aspose,

I have used the follwing code to convert PPTX to pdf.

PresentationEx presEx = new PresentationEx(PresentationStream);
presEx.Save(OutStream, Aspose.Slides.Export.SaveFormat.Pdf);
for ppt to pdf
Presentation pres = new Presentation(PresentationStream);
pres.Save(OutStream, Aspose.Slides.Export.SaveFormat.Pdf);

Here presentation stream is a memory stream.It is showing the exception as
Object reference not set to an instance of an object.
and it is not keeping the format of slides as it is.
I will upload here a ppt,resulted pdf.
Test at your side and suggest me the solution.

Hello Dear,

I have worked with the presentation file shared by using Aspose.Slides for .NET 5.0.1. I have been successfully able to generate the PDF file. Can you please trying using the mentioned product version with the PPT file you have shared. Please share with us, if the issue still persists.

Thanks and Regards,

Hi Aspose,
Thank you for such a quick response.
I also used the same version Aspose.Slides for .NET 5.0.1.Still the error persists.Can you share the code you used for your program.
Kindly review it.

Hello Dear,

I have worked with the presentation file shared using the following code snippet with mentioned version of Aspose.Slides for .NET. For your kind reference, I have also shared the generated PDF here: https://apps.banckle.com/file/g/?v=c79f6MApU90&f=ASP.Net+Web+Controls+and+Web+Parts.pdf.
Please share, if you still feel any issue.

FileStream fileStream = File.OpenRead(“D:\Aspose Data\ASP.Net+Web+Controls+and+Web+Parts.ppt”);

Presentation templatePres = new Presentation(fileStream);

fileStream.Flush();

fileStream.Close();

MemoryStream ms = new MemoryStream();

templatePres.Save(ms, Aspose.Slides.Export.SaveFormat.Pdf);

FileStream outStream = File.OpenWrite(“D:\Aspose Data\ASP.Net+Web+Controls+and+Web+Parts.pdf”);

ms.WriteTo(outStream);

outStream.Flush();

outStream.Close();

Thanks and Regards,