我可以使用 Microsoft.Office.Interop.PowerPoint DLL 的 Presentation 类将 Power Point Slides 导出到图像到我的本地路径,下面是我的代码,
是否可以将该图像加载到内存流而不是本地存储中?
如何覆盖/扩展
Slide.Export()
函数以将该图像加载到内存流中。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); }