VintaSoft Imaging .NET SDK 11.0
Vintasoft.Imaging.Pdf.Tree.Annotations Namespace / PdfAnnotationList Class
Members Example



In This Topic
    PdfAnnotationList Class
    In This Topic
    Represents a collection of PdfAnnotation objects.
    Object Model
    PdfAnnotationList ClassPdfAnnotation Class
    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 PdfAnnotation)
    [DebuggerTypeProxy(Vintasoft.Imaging.Pdf.Utils.CollectionDebugView`1)]
    [DebuggerDisplay("Count = {Count}")]
    [DefaultMember("Item")]
    public sealed class PdfAnnotationList : Vintasoft.Imaging.Pdf.Tree.PdfTreeNodeList<PdfAnnotation> 
    [DebuggerTypeProxy(Vintasoft.Imaging.Pdf.Utils.CollectionDebugView`1)]
    [DebuggerDisplay("Count = {Count}")]
    [DefaultMember("Item")]
    public __gc __sealed class PdfAnnotationList : public Vintasoft.Imaging.Pdf.Tree.PdfTreeNodeList<PdfAnnotation> 
    [DebuggerTypeProxy(Vintasoft.Imaging.Pdf.Utils.CollectionDebugView`1)]
    [DebuggerDisplay("Count = {Count}")]
    [DefaultMember("Item")]
    public ref class PdfAnnotationList sealed : public Vintasoft.Imaging.Pdf.Tree.PdfTreeNodeList<PdfAnnotation> 
    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

    System.Object
       Vintasoft.Imaging.Pdf.Tree.PdfTreeNodeBase
          Vintasoft.Imaging.Pdf.Tree.PdfTreeNodeList<T>
             Vintasoft.Imaging.Pdf.Tree.Annotations.PdfAnnotationList

    Requirements

    Target Platforms: .NET 6; .NET 5; .NET Core 3.1; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    See Also