Annoatation list

Annoations can be viewed as a list in this UI component

View annotations as list in Xamarin.iOS

This tutorial only applies to Xamarin.iOS. See Xamarin.Android equivalent here .

The PTAnnotationViewController class shows a list of all annotations in a document being viewed by a PTPDFViewCtrl. The list contains any comments that have been added to the annotations.

Apryse Docs Image

The annotations list control is part of the Tools library, so make sure you have added the Tools library to your project.

Show an annotation view controller

To create a new annotation view controller instance and display it from another view controller, supply a PTPDFViewCtrl instance to the PTAnnotationViewController designated initializer:

C#

1var annotationViewController = new pdftron.PDF.Controls.PTAnnotationViewController (mPdfViewCtrl);
2annotationViewController.AnnotationViewControllerAnnotationSelected += (object sender, AnnotationViewControllerAnnotationSelectedEventArgs e) => {
3 // perform custom action
4 this.DismissViewController (true, null);
5};
6annotationViewController.AnnotationViewControllerDidCancel += (object sender, EventArgs e) => {
7 this.DismissViewController (true, null);
8};
9
10var navigationController = new UINavigationController (annotationViewController);
11if (UserInterfaceIdiomIsPad)
12{
13 navigationController.ModalPresentationStyle = UIModalPresentationStyle.Popover;
14 navigationController.PopoverPresentationController.BarButtonItem = annotationListButton;
15}
16
17this.PresentViewController (navigationController, true, null);

The annotation view controller must be pushed onto a navigation controller's stack before being shown.

Presenting on iPads:

The annotation view controller is designed to be presented in a popover on iPads. To do so, you must provide the PTAnnotationViewController's PopoverPresentationController with either:

OR

as in the example above.

You can set a delegate to be notified by the annotation view controller when annotations are selected with the PTAnnotationViewControllerDelegate protocol. (See the CompleteReader sample for usage of the PTAnnotationViewController.)

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales