亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

在C#里面給PPT文檔添加注釋的實(shí)現(xiàn)代碼

 更新時(shí)間:2017年01月24日 22:35:55   投稿:mdxy-dxy  
平常開(kāi)會(huì)或者做總結(jié)報(bào)告的時(shí)候我們通常都會(huì)用到PowerPoint演示文稿,我們可以在單個(gè)幻燈片或者全部幻燈片里面添加注釋?zhuān)@樣觀眾可以從注釋內(nèi)容里面獲取更多的相關(guān)信息,需要的朋友可以參考下

平常開(kāi)會(huì)或者做總結(jié)報(bào)告的時(shí)候我們通常都會(huì)用到PowerPoint演示文稿,我們可以在單個(gè)幻燈片或者全部幻燈片里面添加注釋?zhuān)@樣觀眾可以從注釋內(nèi)容里面獲取更多的相關(guān)信息。

有些朋友不清楚如何在幻燈片里面添加注釋?zhuān)旅嫖腋蠹曳窒硪幌氯绾卧贑#里面為幻燈片添加注釋。

在這里我使用了一個(gè)免費(fèi)控件——Free Spire.Presentation,有興趣的朋友可以下載使用。

需要添加的命名空間:

using Spire.Presentation;
using System.Drawing;

詳細(xì)步驟和代碼片段如下:

步驟1:新建一個(gè)Presentation對(duì)象,從系統(tǒng)里面加載Presentation文件。

Presentation presentation = new Presentation();
presentation.LoadFromFile("sample.pptx");

步驟2:調(diào)用CommentAuthorList.AddAuthor(author name, string initials) 方法來(lái)添加作者注釋。

ICommentAuthor author = presentation.CommentAuthors.AddAuthor("E-iceblue", "comment:");

步驟3:調(diào)用Call presentation.Slides[].AddComment() 方法來(lái)給某一張?zhí)囟ɑ脽羝砑幼⒔?。注釋的?lèi)包含很多信息,像添加注釋的作者、添加注釋的時(shí)間、添加注釋的位置和注釋的內(nèi)容。

presentation.Slides[1].AddComment(author, "This part is pretty important. Please pay attention to it", new System.Drawing.PointF(42, 4), DateTime.Now);

步驟4:保存并重新打開(kāi)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文檔添加注釋的實(shí)現(xiàn)代碼,需要的朋友可以參考一下。

相關(guān)文章

最新評(píng)論