欧美大屁股bbbbxxxx,狼人大香伊蕉国产www亚洲,男ji大巴进入女人的视频小说,男人把ji大巴放进女人免费视频,免费情侣作爱视频

歡迎來到入門教程網(wǎng)!

C#教程

當前位置:主頁 > 軟件編程 > C#教程 >

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

來源:本站原創(chuàng)|時間:2020-01-10|欄目:C#教程|點擊: 次

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

有些朋友不清楚如何在幻燈片里面添加注釋,下面我跟大家分享一下如何在C#里面為幻燈片添加注釋。

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

需要添加的命名空間:

using Spire.Presentation;
using System.Drawing;

詳細步驟和代碼片段如下:

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

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

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

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

步驟3:調(diào)用Call presentation.Slides[].AddComment() 方法來給某一張?zhí)囟ɑ脽羝砑幼⒔?。注釋的類包含很多信息,像添加注釋的作者、添加注釋的時間、添加注釋的位置和注釋的內(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:保存并重新打開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文檔添加注釋的實現(xiàn)代碼,需要的朋友可以參考一下。

上一篇:httpwebreqeust讀取httponly的cookie方法

欄    目:C#教程

下一篇:C#遍歷文件夾及子目錄下所有圖片

本文標題:在C#里面給PPT文檔添加注釋的實現(xiàn)代碼

本文地址:http://mengdiqiu.com.cn/a1/C_jiaocheng/5979.html

網(wǎng)頁制作CMS教程網(wǎng)絡(luò)編程軟件編程腳本語言數(shù)據(jù)庫服務(wù)器

如果侵犯了您的權(quán)利,請與我們聯(lián)系,我們將在24小時內(nèi)進行處理、任何非本站因素導致的法律后果,本站均不負任何責任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有