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

Free Support Forum - aspose.com

Create PresentationEx from MemoryStream

Hello. How can i create PresentationEx from MemoryStream. I tried to do it, but i had exception "Unknown file format.". Could you help?
var p1 = new PresentationEx();
var stream = new MemoryStream();
p1.Save(stream, SaveFormat.Pptx);
var p2 = new PresenationEx(stream);

Hi,


I have observed the sample code shared and like to share that there is issue in sample code. Once you write presentation to stream, you need to reset its position to 0 either you want to save that to file or load in another presentation instance.

var p1 = new PresentationEx();
var stream = new MemoryStream();
p1.Save(stream, SaveFormat.Pptx);
stream.Position = 0;
var p2 = new PresentationEx(stream);

Please use the above sample code and share with us if there is any further issue.

Many Thanks,

oh, my fail. Your code works fine. Thank you.