2011-03-16 50 views
0

我在线上看到了一个powerpoint演示文稿(ppt),它是一个.ppt文件,它运行在Web浏览器中。所以不需要导出到html,swf等,并且在图像方面质量相当好。在浏览器中运行PPT作为.ppt

任何想法如何做到这一点?

回答

0

对于单个演示文稿,您可以使用Google文档的演示文稿“嵌入”功能(将文件上传到Google文档,然后单击共享...发布/嵌入)。

对于也是基于这样的一个系统的解决方案,我建议考虑看看Google Docs' API

1

试试这个代码

string ExportLocation = "C:\\Sample"; 
Microsoft.Office.Interop.PowerPoint.Application ppApp = new Microsoft.Office.Interop.PowerPoint.Application(); 
ppApp.Visible = MsoTriState.msoTrue; 
ppApp.WindowState = PpWindowState.ppWindowMinimized; 
Microsoft.Office.Interop.PowerPoint.Presentations oPresSet = ppApp.Presentations; 
Microsoft.Office.Interop.PowerPoint._Presentation oPres = oPresSet.Open("C:\\ScreenShots.ppt", 
      MsoTriState.msoFalse, MsoTriState.msoFalse, 
      MsoTriState.msoFalse); 
ppApp.ShowWindowsInTaskbar = MsoTriState.msoFalse; //Hiding the application; But it will be displayed always 
try 
{ 
    Slides objSlides = oPres.Slides; //Getting all the slides 
    for (int i = 1; i < objSlides.Count - 1; i++) 
    { 
     string file = Path.Combine(ExportLocation, string.Format("{0}.{1}", objSlides[i].Name, "jpg")); 
     oPres.Slides[i].Export(file, "jpg", 800, 600); 
    } 
} 
finally 
{ 
    ppApp.Quit(); //Closing the Powerpoint application. Sometimes it won't work too. 
} 
+0

哪里上下文这个答案。你说过试试这个代码。试试这个代码是什么?它究竟做了什么? – 2016-08-16 07:04:06