menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfExportAnnotationCollection - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class PdfExportAnnotationCollection

    The class provides methods and properties to handle the collection of PdfLoadedAnnotation for exporting.

    Inheritance
    System.Object
    PdfCollection
    PdfExportAnnotationCollection
    Implements
    System.Collections.IEnumerable
    Inherited Members
    PdfCollection.Count
    PdfCollection.GetEnumerator()
    PdfCollection.List
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Syncfusion.Pdf.Parsing
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public class PdfExportAnnotationCollection : PdfCollection, IEnumerable
    Examples
    //Load an existing document
    PdfLoadedDocument document = new PdfLoadedDocument("Input.pdf");
    //Initialize an object for export annotation collection
    PdfExportAnnotationCollection collection = new PdfExportAnnotationCollection();
    //Get the first page from the document
    PdfLoadedPage page = document.Pages[0] as PdfLoadedPage;
    //Add loaded annotations into the export annotation collection
    collection.Add(page.Annotations[0] as PdfLoadedAnnotation);
    collection.Add(page.Annotations[1] as PdfLoadedAnnotation);
    //Get the second page from the document
    page = document.Pages[1] as PdfLoadedPage;
    //Add loaded annotations into the export annotation collection
    collection.Add(page.Annotations[0] as PdfLoadedAnnotation);
    collection.Add(page.Annotations[1] as PdfLoadedAnnotation);
    //Export selected annotation's data into FDF format
    document.ExportAnnotations("Annotations.Fdf", AnnotationDataFormat.Fdf, "Annotations.Pdf", collection);
    //Close and dispose the document
    document.Close(true);
    document.Dispose();
    'Load an existing document
    Dim document As New PdfLoadedDocument("Input.pdf")
    'Initialize an object for export annotation collection
    Dim collection As New PdfExportAnnotationCollection()
    'Get the first page from the document
    Dim page As PdfLoadedPage = TryCast(document.Pages(0), PdfLoadedPage)
    'Add loaded annotations into the export annotation collection
    collection.Add(TryCast(page.Annotations[0], PdfLoadedAnnotation))
    collection.Add(TryCast(page.Annotations[1], PdfLoadedAnnotation))
    'Get the second page from the document
    page = TryCast(document.Pages(1), PdfLoadedPage)
    'Add loaded annotations into the export annotation collection
    collection.Add(TryCast(page.Annotations[0], PdfLoadedAnnotation))
    collection.Add(TryCast(page.Annotations[1], PdfLoadedAnnotation))
    'Export selected annotation's data into FDF format
    document.ExportAnnotations("Annotations.Fdf", AnnotationDataFormat.Fdf, "Annotations.Pdf", collection)
    'Close and dispose the document
    document.Close(true)
    document.Dispose()

    Constructors

    PdfExportAnnotationCollection()

    Initializes a new instance of the PdfExportAnnotationCollection class.

    Declaration
    public PdfExportAnnotationCollection()
    Examples
    //Load an existing document
    PdfLoadedDocument document = new PdfLoadedDocument("Input.pdf");
    //Initialize an object for export annotation collection
    PdfExportAnnotationCollection collection = new PdfExportAnnotationCollection();
    //Get the first page from the document
    PdfLoadedPage page = document.Pages[0] as PdfLoadedPage;
    //Add loaded annotations into the export annotation collection
    collection.Add(page.Annotations[0] as PdfLoadedAnnotation);
    collection.Add(page.Annotations[1] as PdfLoadedAnnotation);
    //Export selected annotation's data into FDF format
    document.ExportAnnotations("Annotations.Fdf", AnnotationDataFormat.Fdf, "Annotations.Pdf", collection);
    //Close and dispose the document
    document.Close(true);
    document.Dispose();
    'Load an existing document
    Dim document As New PdfLoadedDocument("Input.pdf")
    'Initialize an object for export annotation collection
    Dim collection As New PdfExportAnnotationCollection()
    'Get the first page from the document
    Dim page As PdfLoadedPage = TryCast(document.Pages(0), PdfLoadedPage)
    'Add loaded annotations into the export annotation collection
    collection.Add(TryCast(page.Annotations[0], PdfLoadedAnnotation))
    collection.Add(TryCast(page.Annotations[1], PdfLoadedAnnotation))
    'Export selected annotation's data into FDF format
    document.ExportAnnotations("Annotations.Fdf", AnnotationDataFormat.Fdf, "Annotations.Pdf", collection)
    'Close and dispose the document
    document.Close(true)
    document.Dispose()

    Properties

    Item[Int32]

    Gets the PdfAnnotation at the specified index.

    Declaration
    public PdfAnnotation this[int index] { get; }
    Parameters
    Type Name Description
    System.Int32 index
    Property Value
    Type Description
    PdfAnnotation

    Returns the annotation at the specified index

    Examples
    //Load an existing document
    PdfLoadedDocument document = new PdfLoadedDocument("Input.pdf");
    //Initialize an object for export annotation collection
    PdfExportAnnotationCollection collection = new PdfExportAnnotationCollection();
    //Get the first page from the document
    PdfLoadedPage page = document.Pages[0] as PdfLoadedPage;
    //Add annotations into the export annotation collection
    collection.Add(page.Annotations[0] as PdfAnnotation);
    collection.Add(page.Annotations[1] as PdfAnnotation);
    //Gets the annotation at the specified index
    PdfAnnotation annotation = collection[1];
    //Export selected annotation's data into FDF format
    document.ExportAnnotations("Annotations.Fdf", AnnotationDataFormat.Fdf, "Annotations.Pdf", collection);
    //Close and dispose the document
    document.Close(true);
    document.Dispose();
    'Load an existing document
    Dim document As New PdfLoadedDocument("Input.pdf")
    'Initialize an object for export annotation collection
    Dim collection As New PdfExportAnnotationCollection()
    'Get the first page from the document
    Dim page As PdfLoadedPage = TryCast(document.Pages(0), PdfLoadedPage)
    'Add annotations into the export annotation collection
    collection.Add(TryCast(page.Annotations[0], PdfAnnotation))
    collection.Add(TryCast(page.Annotations[1], PdfAnnotation))
    'Gets the annotation at the specified index
    Dim annotation As PdfAnnotation = collection[1]
    'Export selected annotation's data into FDF format
    document.ExportAnnotations("Annotations.Fdf", AnnotationDataFormat.Fdf, "Annotations.Pdf", collection)
    'Close and dispose the document
    document.Close(true)
    document.Dispose()

    Methods

    Add(PdfAnnotation)

    Adds annotation to the collection.

    Declaration
    public void Add(PdfAnnotation annotation)
    Parameters
    Type Name Description
    PdfAnnotation annotation
    Examples
    //Load an existing document
    PdfLoadedDocument document = new PdfLoadedDocument("Input.pdf");
    //Initialize an object for export annotation collection
    PdfExportAnnotationCollection collection = new PdfExportAnnotationCollection();
    //Get the first page from the document
    PdfLoadedPage page = document.Pages[0] as PdfLoadedPage;
    //Add annotations into the export annotation collection
    collection.Add(page.Annotations[0] as PdfAnnotation);
    collection.Add(page.Annotations[1] as PdfAnnotation);
    //Get the second page from the document
    page = document.Pages[1] as PdfLoadedPage;
    //Add loaded annotations into the export annotation collection
    collection.Add(page.Annotations[0] as PdfAnnotation);
    collection.Add(page.Annotations[1] as PdfAnnotation);
    //Export selected annotation's data into FDF format
    document.ExportAnnotations("Annotations.Fdf", AnnotationDataFormat.Fdf, "Annotations.Pdf", collection);
    //Close and dispose the document
    document.Close(true);
    document.Dispose();
    'Load an existing document
    Dim document As New PdfLoadedDocument("Input.pdf")
    'Initialize an object for export annotation collection
    Dim collection As New PdfExportAnnotationCollection()
    'Get the first page from the document
    Dim page As PdfLoadedPage = TryCast(document.Pages(0), PdfLoadedPage)
    'Add annotations into the export annotation collection
    collection.Add(TryCast(page.Annotations[0], PdfAnnotation))
    collection.Add(TryCast(page.Annotations[1], PdfAnnotation))
    'Get the second page from the document
    page = TryCast(document.Pages(1), PdfLoadedPage)
    'Add loaded annotations into the export annotation collection
    collection.Add(TryCast(page.Annotations[0], PdfAnnotation))
    collection.Add(TryCast(page.Annotations[1], PdfAnnotation))
    'Export selected annotation's data into FDF format
    document.ExportAnnotations("Annotations.Fdf", AnnotationDataFormat.Fdf, "Annotations.Pdf", collection)
    'Close and dispose the document
    document.Close(true)
    document.Dispose()

    Implements

    System.Collections.IEnumerable

    Extension Methods

    EnumerableExtensions.GetElementType(IEnumerable)
    EnumerableExtensions.GetItemPropertyInfo(IEnumerable)
    FunctionalExtensions.ForEach<T>(IEnumerable, Action<T>)
    FunctionalExtensions.ToList<T>(IEnumerable)
    QueryableExtensions.OfQueryable(IEnumerable)
    QueryableExtensions.OfQueryable(IEnumerable, Type)
    QueryableExtensions.GroupByMany<TElement>(IEnumerable, Type, List<Func<TElement, Object>>)
    QueryableExtensions.GroupByMany(IEnumerable, Type, Func<String, Expression>, String[])
    QueryableExtensions.GroupByMany(IEnumerable, Type, List<SortDescriptor>, Dictionary<String, IComparer<Object>>, Func<String, Expression>, String[])
    QueryableExtensions.GroupByMany(IEnumerable, Type, List<SortDescriptor>, Func<String, Expression>, String[])
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved