Some test text!
iOS / Guides / Outline tree
There are two options to working with an outline tree. First is using a UI component that provides tools to set a bookmark or display the outline. Second is an API guide to programmatically read outline items.
A document outline, or table of contents, demonstrates how the PDF document is organized and helps users see the overall picture. The PTOutlineViewController
class shows the document outline (table of contents) that can be used to navigate through the document being viewed by a PTPDFViewCtrl
by tapping on a bookmark item.
The outline control is part of the Tools library, so make sure you have added the Tools library to your project .
To create a new outline view controller instance and display it from another view controller, supply a PTPDFViewCtrl
instance to the PTOutlineViewController
designated initializer:
// Initialize outline view controller with a PTPDFViewCtrl instance.
let outlineViewController = PTOutlineViewController(pdfViewCtrl: pdfViewCtrl)
// Set the current view controller as the outline view controller's delegate.
outlineViewController.delegate = self
let navigationController = UINavigationController(rootViewController: outlineViewController)
if ( UIDevice.current.userInterfaceIdiom == .pad ) {
navigationController.modalPresentationStyle = .popover
navigationController.popoverPresentationController?.barButtonItem = outlineButton
}
self.present(navigationController, animated: true, completion: nil)
PTOutlineViewController
's
UIPopoverPresentationController
with either:
sourceRect
AND sourceView
You can set a delegate to be notified by the outline view controller when outline bookmarks are selected with the PTOutlineViewControllerDelegate
protocol. (See the CompleteReader example for usage of an PTOutlineViewController
.)
Trial setup questions? Ask experts on Discord
Need other help? Contact Support
Pricing or product questions? Contact Sales