Class PdfExportAnnotationCollection
The class provides methods and properties to handle the collection of PdfLoadedAnnotation for exporting.
Implements
System.Collections.IEnumerable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
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 PdfLoadedAnnotation at the specified index.
Declaration
public PdfLoadedAnnotation this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Property Value
Type | Description |
---|---|
PdfLoadedAnnotation | 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 loaded annotations into the export annotation collection
collection.Add(page.Annotations[0] as PdfLoadedAnnotation);
collection.Add(page.Annotations[1] as PdfLoadedAnnotation);
//Gets the annotation at the specified index
PdfLoadedAnnotation 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 loaded annotations into the export annotation collection
collection.Add(TryCast(page.Annotations[0], PdfLoadedAnnotation))
collection.Add(TryCast(page.Annotations[1], PdfLoadedAnnotation))
'Gets the annotation at the specified index
Dim annotation As PdfLoadedAnnotation = 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(PdfLoadedAnnotation)
Adds annotation to the collection.
Declaration
public void Add(PdfLoadedAnnotation annotation)
Parameters
Type | Name | Description |
---|---|---|
PdfLoadedAnnotation | 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 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()
Implements
System.Collections.IEnumerable