【问题标题】:Simple Example of creating a PowerPoint file创建 PowerPoint 文件的简单示例
【发布时间】:2010-12-09 03:38:32
【问题描述】:

我正在寻找一些关于如何添加图像和文本并将其输出为 PowerPoint 文件的示例代码。 主机服务器没有 Office,我不允许安装任何东西,因此“使用 Open XML 格式 API 处理 Excel 2007 和 PowerPoint 2007 文件”对我没有帮助。 以下是输出 PowerPoint 的代码。我只是不知道要添加文字和图片。

    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();

【问题讨论】:

  • Aron,澄清一下,您需要服务器添加图像/文本,还是可以在客户端执行此操作并将编辑后的文件添加回服务器?

标签: powerpoint openxml


【解决方案1】:

如果您不能使用 Open XML 格式 API,那么一个不好的方法是通过代码创建整个包/XML/ZIP,我认为这是一个不好的解决方案....

好文章如何使用 Open Xml API 创建 ppt http://openxmldeveloper.org/articles/7429.aspx

祝你好运

【讨论】:

  • 很棒的文章,展示了如何向幻灯片添加幻灯片 + 图像。使用 openxml 2.5 生产力工具重新创建模板文件并创建一个新的 Visual Studio 项目并拖动示例代码以使其运行。
猜你喜欢
  • 1970-01-01
  • 2011-08-08
  • 1970-01-01
  • 1970-01-01
  • 2014-09-27
  • 2017-11-09
  • 1970-01-01
  • 2014-08-29
  • 2015-12-28
相关资源
最近更新 更多