VintaSoft Imaging .NET SDK 15.2: Documentation for .NET developer
Vintasoft.Imaging.Pdf.Tree.Annotations Namespace / PdfAnnotationList Class
Members Object Syntax Example Hierarchy Requirements SeeAlso
In This Topic
PdfAnnotationList Class
In This Topic
Represents a collection of PdfAnnotation objects.
Object Model
PdfAnnotation PdfDocument PdfIndirectReference PdfBasicObject PdfAnnotationList
Syntax
'Declaration

<DebuggerTypeProxyAttribute(Vintasoft.Imaging.Pdf.Utils.CollectionDebugView`1)>
<DebuggerDisplayAttribute("Count = {Count}")>
<DefaultMemberAttribute("Item")>
Public NotInheritable Class PdfAnnotationList
   Inherits Vintasoft.Imaging.Pdf.Tree.PdfTreeNodeList(Of T)

[DebuggerTypeProxy(Vintasoft.Imaging.Pdf.Utils.CollectionDebugView`1)]
[DebuggerDisplay("Count = {Count}")]
[DefaultMember("Item")]
public sealed class PdfAnnotationList : Vintasoft.Imaging.Pdf.Tree.PdfTreeNodeList<T>

Example

Here is an example that shows how to delete an annotation from PDF page:


''' <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;
}

Inheritance Hierarchy
Requirements

Target Platforms: .NET 11; .NET 10; .NET 9; .NET 8; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

See Also