文檔首頁>>Aspose.PDF使用教程>>Aspose.Pdf使用教程:刪除PDF文件中的指定注釋
Aspose.Pdf使用教程:刪除PDF文件中的指定注釋
Aspose.Pdf從PDF文件中刪除指定注釋,需要調(diào)用[*Annotations*] 集合中的Delete方法,這個集合屬于注釋存在的頁面對象,Delete方法需要被刪除注釋的指數(shù)。之后,保存更新之后的PDF文檔。
下面是代碼示例:
C#
//open document Document pdfDocument = new Document("input.pdf"); //delete particular annotation pdfDocument.Pages[1].Annotations.Delete(1); //save updated document pdfDocument.Save("output.pdf");
VB.NET
'open document Dim pdfDocument As New Document("input.pdf") 'delete particular annotation pdfDocument.Pages(1).Annotations.Delete(1) 'save updated document pdfDocument.Save("output.pdf")