Zoom to specific PDF annotations easily

When a PDF loads in Nutrient, and you want to zoom in to a particular annotation, you can do this by passing the annotation’s bounding box to the zoom(toPDFRect:forPageAt:animated:) method of PDFDocumentViewController:

class CustomPDFViewController: PDFViewController {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
// Find the first annotation for demonstration purposes.
guard let document = self.document, let annotation = document.annotationsForPage(at: 0, type: .all).first else {
return
}
self.documentViewController?.zoom(toPDFRect: annotation.boundingBox, forPageAt: 0, animated: true)
}
}

This has been tested with Nutrient iOS SDK 8.4.