try { //license license_PowerPoint = new Aspose.Slides.License(); license_PowerPoint.SetLicense("Aspose.Total.lic"); //end license
ppt = new Aspose.Slides.Presentation(Orig_File); stream = new System.IO.MemoryStream(); ppt.SaveToPdf(stream);
return stream;
}
On the line highlighted in yellow (Note the input is a memory stream) I get the following error message: System.IndexOutOfRangeException: Index was outside the bounds of the array.
Attached to this post is the simple power point test we are using.
I did not, I have not had to do that with any of the other file types (Word, Excel…) also I have not done anything with the stream yet so shouldn’t it be at position 0 already?
It depends on how this MemoryStream was created. If you created it from byte array then position should be at 0. But if you wrote data to the stream and try to read it back with Presentation constructor then it can’t be at 0.
Since we tested your presentation with latest version of Aspose.Slides and there are no problems then most probably something wrong with the stream. Another possible reason is Aspose.Slides wasn’t updated properly and your application still use old version.