Export Power Point slides into images then memory stream

1k views Asked by At

I able to export Power Point Slides into images to my local path by using Microsoft.Office.Interop.PowerPoint DLL's Presentation classes, below is my code,

  1. Is it possible to load that image into a Memory Stream instead of local storage?

  2. How to Overwrite/ extend Slide.Export() function to load that image into a memory stream.

    Microsoft.Office.Interop.PowerPoint.Application pptApplication = new Microsoft.Office.Interop.PowerPoint.Application();
    
    Microsoft.Office.Interop.PowerPoint.Presentation pptPresentation = pptApplication.Presentations.Open2007(awsFilePath, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoFalse);
    
    foreach (Microsoft.Office.Interop.PowerPoint.Slide pptSlide in pptPresentation.Slides)
      {                                        
           pptSlide.Export(Server.MapPath("~/" + new Random().Next().ToString() + ".png"), "PNG", 1024, 768);
       }
    
0

There are 0 answers