原創|使用教程|編輯:郝浩|2013-03-18 13:42:01.000|閱讀 951 次
概述:為了從PDF文檔中獲取PDF文件頁的注釋,一般需要依次查看指定PDF頁中的Annotations注釋集。可以以MarkupAnnotation的基礎注釋類型的方式得到每個集合的所有注釋,并顯示其屬性。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
為了從PDF文檔中獲取PDF文件頁的注釋,一般需要依次查看指定PDF頁中的Annotations注釋集。請注意,如果你想獲得整個PDF的所有注釋,就不得不在瀏覽注釋集合之前查看文檔的Pages頁面集合。你可以以名叫MarkupAnnotation的基礎注釋類型的方式得到每個集合的所有注釋,并顯示其屬性。
》》》下載Aspose.Pdf試用版
下面是代碼示例:
C#
//open document Document pdfDocument = new Document("input.pdf"); //loop through all the annotations foreach (MarkupAnnotation annotation in pdfDocument.Pages[1].Annotations) { //get annotation properties Console.WriteLine("Title : {0} ", annotation.Title); Console.WriteLine("Subject : {0} ", annotation.Subject); Console.WriteLine("Contents : {0} ", annotation.Contents); Console.WriteLine("ReadOnly : {0} ", annotation.ReadOnly); }
VB.NET
'open document Dim pdfDocument As New Document("input.pdf") 'loop through all the annotations For Each annotation As MarkupAnnotation In pdfDocument.Pages(1).Annotations 'get annotation properties Console.WriteLine("Title : {0} ", annotation.Title) Console.WriteLine("Subject : {0} ", annotation.Subject) Console.WriteLine("Contents : {0} ", annotation.Contents) Console.WriteLine("ReadOnly : {0} ", annotation.ReadOnly) Next annotation
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自:慧都控件網