Some test text!

menu
search
Annotation listkeyboard_arrow_down

Annotation list

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.

Annotation view controller

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

linkShow 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:

// Initialize annotation view controller with a PTPDFViewCtrl instance.
let annotationViewController = PTAnnotationViewController(pdfViewCtrl: pdfViewCtrl)

// Set the current view controller as the annotation view controller's delegate.
annotationViewController.delegate = self

let navigationController = UINavigationController(rootViewController: annotationViewController)
if ( UIDevice.current.userInterfaceIdiom == .pad ) {
    navigationController.modalPresentationStyle = .popover
    navigationController.popoverPresentationController?.barButtonItem = annotationListButton
}

self.present(navigationController, animated: true, completion: nil)
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 UIPopoverPresentationController 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.)

Get the answers you need: Support

close

Free Trial

Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.

Select a platform to get started with your free trial.

Unlimited usage. No email address required.

PDFTron Receives USD$71 Million Growth Investment Led By Silversmith Capital Partners

Learn more
close