Class PdfExportAnnotationCollection
- Namespace
- Syncfusion.Pdf.Parsing
- Assembly
- Syncfusion.Pdf.Portable.dll
The class provides methods and properties to handle the collection of PdfLoadedAnnotation for exporting.
public class PdfExportAnnotationCollection : PdfCollection, IEnumerable
- Inheritance
-
PdfExportAnnotationCollection
- Implements
- Inherited Members
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.
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
this[int]
Gets the PdfLoadedAnnotation at the specified index.
public PdfLoadedAnnotation this[int index] { get; }
Parameters
index
int
Property Value
- 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.
public void Add(PdfLoadedAnnotation annotation)
Parameters
annotation
PdfLoadedAnnotation
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()