Представляет коллекцию объектов
PdfAnnotation.
Вот пример, показывающий, как удалить аннотацию с PDF страницы:
''' <summary>
''' Removes the first annotation from PDF page
''' if it is a link annotation.
''' </summary>
''' <param name="page">The page of PDF document.</param>
Public Shared Function RemoveAnnotationFromPdfPage(page As Vintasoft.Imaging.Pdf.Tree.PdfPage) As Boolean
' if annotations exist
If page.Annotations IsNot Nothing AndAlso page.Annotations.Count > 0 Then
' if contents of the first annotation if it is a link
If TypeOf page.Annotations(0) Is Vintasoft.Imaging.Pdf.Tree.Annotations.PdfLinkAnnotation Then
' remove the annotation
page.Annotations.RemoveAt(0)
Return True
End If
End If
Return False
End Function
/// <summary>
/// Removes the first annotation from PDF page
/// if it is a link annotation.
/// </summary>
/// <param name="page">The page of PDF document.</param>
public static bool RemoveAnnotationFromPdfPage(Vintasoft.Imaging.Pdf.Tree.PdfPage page)
{
// if annotations exist
if (page.Annotations != null && page.Annotations.Count > 0)
{
// if contents of the first annotation if it is a link
if (page.Annotations[0] is Vintasoft.Imaging.Pdf.Tree.Annotations.PdfLinkAnnotation)
{
// remove the annotation
page.Annotations.RemoveAt(0);
return true;
}
}
return false;
}
Целевые платформы: .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5