Simple Example of creating a PowerPoint file

早过忘川 提交于 2019-12-01 11:23:17

问题


I'm looking for some sample code on how to add an image and text & output it as a PowerPoint file. The host server does not have Office and I'm not allowed to install anything so the "Manipulating Excel 2007 and PowerPoint 2007 Files with the Open XML Format API " will not help me. Below is the code the output the PowerPoint. I just don't know of to add text and images.

    Response.ClearContent();
    Response.AddHeader("content-disposition", "attachment;filename=Filename.ppt");
    Response.ContentType = "application/powerpoint";
    System.IO.StringWriter sw = new System.IO.StringWriter();
    System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw);
    Response.Write(sw.ToString());
    Response.End();

回答1:


If you cant use the Open XML Format API then a bad approach would be to create the whole package/XML/ZIP by code which I feel is a bad solution....

Good article how to create ppt using Open Xml API http://openxmldeveloper.org/articles/7429.aspx

Good luck



来源:https://stackoverflow.com/questions/1608138/simple-example-of-creating-a-powerpoint-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!