User-defined bookmarks for iOS

The PTBookmarkViewController class shows a list of user-defined bookmarks that can be used to navigate through the document. The user-defined bookmarks are Apryse specific features that may not be shown in other PDF viewer apps. If you want to manage PDF bookmarks so that they can be processed in other standard PDF viewers, see the outline view controller guide.

Apryse Docs Image

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

Show a bookmark view controller

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

1// Initialize bookmark view controller with a PTPDFViewCtrl instance.
2let bookmarkViewController = PTBookmarkViewController(pdfViewCtrl: pdfViewCtrl)
3
4// Set the current view controller as the bookmark view controller's delegate.
5bookmarkViewController.delegate = self
6
7let navigationController = UINavigationController(rootViewController: bookmarkViewController)
8if ( UIDevice.current.userInterfaceIdiom == .pad ) {
9 navigationController.modalPresentationStyle = .popover
10 navigationController.popoverPresentationController?.barButtonItem = bookmarksButton
11}
12
13self.present(navigationController, animated: true, completion: nil)

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

Presenting on iPads:

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

OR

as in the example above.

You can set a delegate to be notified by the bookmark view controller when bookmarks are selected with the PTBookmarkViewControllerDelegate protocol. (See the CompleteReader example for usage of a PTBookmarkViewController.

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales