PPT to Stream or any object

Hi! I would like to know if there’s a way to convert my PPT slides to a Stream or any object.

I’ve seen this code:

//Instantiate a PresentationEx class that represents the PPTX file
PresentationEx pres = new PresentationEx(“d:\pptx\ContentBG_Img.pptx”);

//Access the first slide
SlideEx sld = pres.Slides[0];

//Create a memory stream object
MemoryStream SvgStream=new MemoryStream();

//Generate SVG image of slide and save in memory stream
sld.WriteAsSvg(SvgStream);
SvgStream.Position = 0;

//Save memory stream to file
using (Stream fileStream = System.IO.File.OpenWrite(path + “PresentatoinTemplate.svg”))
{
byte[] buffer = new byte[8 * 1024];
int len;
while ((len = SvgStream.Read(buffer, 0, buffer.Length)) > 0)
{
fileStream.Write(buffer, 0, len);
}

}
SvgStream.Close();

I don’t want it to be stored or saved on a file but instead, I want it to be on a stream for example. Is there a way to replace
System.IO.File.OpenWrite(path + “PresentatoinTemplate.svg”)
with stream? Thanks!



Hi Paulo,


I like to share that Aspose.Slides allows you to export the presentation to Memory Stream. Please visit this documentation link for your kind reference. Please share, if I may help you further in this regard.

Many Thanks,