在浏览器中将 PPT 作为 .ppt 运行

发布于 2024-10-22 12:01:31 字数 112 浏览 2 评论 0原文

我在网上某处看到过一个 .ppt 文件的 powerpoint 演示文稿 (ppt),它在网络浏览器中运行。因此无需导出为 html、swf 等,而且图像质量相当好。

有什么想法如何做到这一点?

I have seen a powerpoint presentation (ppt) somewhere online which was a .ppt file and it ran within the web browser. So no need for exporting to html, swf, etc and it was rather good quality when it came to images.

Any ideas how to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

_失温 2024-10-29 12:01:31

试试这个代码

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.
}

Try this code

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.
}
痴情换悲伤 2024-10-29 12:01:31

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

对于同样基于此的系统解决方案,我建议查看 Google Docs 的 API

For a single presentation you can use Google Docs' presentation "Embed" feature (upload the ppt to Google Docs, then click Share...publish / embed).

For a systematic solution based also on this, I suggest taking a look at Google Docs' API

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文