VintaSoft Imaging .NET SDK v8.7
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
     
    Public NotInheritable Class PdfAnnotationList 
       Inherits Vintasoft.Imaging.Pdf.Tree.PdfTreeNodeList(Of PdfAnnotation)
    public sealed class PdfAnnotationList : Vintasoft.Imaging.Pdf.Tree.PdfTreeNodeList<PdfAnnotation> 
    public __gc __sealed class PdfAnnotationList : public Vintasoft.Imaging.Pdf.Tree.PdfTreeNodeList<PdfAnnotation> 
    public ref class PdfAnnotationList sealed : public Vintasoft.Imaging.Pdf.Tree.PdfTreeNodeList<PdfAnnotation> 
    Example
    This example 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: Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

    See Also