Access Annotations
The steps to access a list of annotations and annotation objects are as follows:
- Obtain the page object.
- Access the list of annotations from the page object.
- Iterate through each annotation object in the list.
This example shows how to access annotations:
C#
CPDFDocument document = CPDFDocument.InitWithFilePath("filePath"); int pageCount = document.PageCount; if(pageCount>0) { for(int pageIndex = 0;pageIndex < pageCount;pageIndex++) { // Obtain the page object and Access the list of annotations within the page object. List<CPDFAnnotation>annotations = document.PageAtIndex(pageIndex).GetAnnotations(); if(annotations != null && annotations.Count != 0) { // Iterate through each annotation object in the list. foreach(CPDFAnnotation annotation in annotations) { // Perform relevant operations on the obtained annotation objects. } } } }