在C#内里给PPT文档完成增加解释的代码分享【C#.Net教程】,PPT,添加注释,PPT
作者:搜教程发布时间:2019-11-27分类:.Net教程浏览:24评论:0
导读:寻常开会或许做总结报告的时刻我们一般都邑用到PowerPoint演示文稿,我们能够在单个幻灯片或许悉数幻灯片内里增加解释,如许观众能够从解释内容内里猎取更多的相干信息,须要的朋侪能...
寻常开会或许做总结报告的时刻我们一般都邑用到PowerPoint演示文稿,我们能够在单个幻灯片或许悉数幻灯片内里增加解释,如许观众能够从解释内容内里猎取更多的相干信息,须要的朋侪能够参考下
寻常开会或许做总结报告的时刻我们一般都邑用到PowerPoint演示文稿,我们能够在单个幻灯片或许悉数幻灯片内里增加解释,如许观众能够从解释内容内里猎取更多的相干信息。
有些朋侪不清楚如安在幻灯片内里增加解释,下面我跟人人分享一下如安在C#内里为幻灯片增加解释。
在这里我运用了一个免费控件——Free Spire.Presentation,有兴致的朋侪能够下载运用。
须要增加的定名空间:
using Spire.Presentation; using System.Drawing;
细致步骤和代码片断以下:
步骤1:新建一个Presentation对象,从体系内里加载Presentation文件。
Presentation presentation = new Presentation(); presentation.LoadFromFile("sample.pptx");
步骤2:挪用CommentAuthorList.AddAuthor(author name, string initials) 要领来增加作者解释。
ICommentAuthor author = presentation.CommentAuthors.AddAuthor("E-iceblue", "comment:");
步骤3:挪用Call presentation.Slides[].AddComment() 要领来给某一张特定幻灯片增加注解。解释的类包括许多信息,像增加解释的作者、增加解释的时候、增加解释的位置和解释的内容。
presentation.Slides[1].AddComment(author, "This part is pretty important. Please pay attention to it", new System.Drawing.PointF(42, 4), DateTime.Now);
步骤4:保留并从新翻开Presentation演示文稿。
presentation.SaveToFile("PPTwithcomment.pptx", FileFormat.Pptx2010); System.Diagnostics.Process.Start("PPTwithcomment.pptx");
效果图:
悉数代码:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Spire.Presentation; namespace PPTComment { class Program { static void Main(string[] args) { //create PPT document and load file Presentation presentation = new Presentation(); presentation.LoadFromFile("sample.pptx"); //comment author ICommentAuthor author = presentation.CommentAuthors.AddAuthor("E-iceblue", "comment:"); //add comment presentation.Slides[1].AddComment(author, "This part is pretty important. Please pay attention to it", new System.Drawing.PointF(42, 4), DateTime.Now); //save the document presentation.SaveToFile("PPTwithcomment.pptx", FileFormat.Pptx2010); System.Diagnostics.Process.Start("PPTwithcomment.pptx"); } } }
以上就是在C#内里给PPT文档完成增加解释的代码分享的细致内容,更多请关注ki4网别的相干文章!
相关推荐
你 发表评论:
欢迎- .Net教程排行
-
- 1案例分享c++ map的运用和 查找机能测试【C#.Net教程】,性能,map,c++
- 2细致引见C# string花样的日期时候字符串转为DateTime范例的要领【C#.Net教程】,C#,string,DateTime
- 3c#怎样运用?c#的基础语法【C#.Net教程】,c#,关键字
- 4详解ASP.NET中衔接数据库设置要领【C#.Net教程】,ASP.NET,数据库,配置
- 5C# DataSet机能最好实践【C#.Net教程】,C#,DataSet
- 6.net和c#有什么区别【C#.Net教程】,.net,c#
- 7C#_挪用封装的一个类完成导出Excel表格的功用【C#.Net教程】,C# Excel表格
- 8asp .net 面试题及答案分享【C#.Net教程】,.net,自己,整理,问题,面试
- 9让WebAPI 返回JSON花样的数据实例教程【C#.Net教程】,javascript,WebAPI,JSON,api,web,搭建,返回
- 最新文章
- 广而告之