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:
The outline view controller is designed to be presented in a popover on iPads. To do so, you must provide the PTOutlineViewController
's PopoverPresentationController
with either:
SourceRect
ANDSourceView
OR
as in the example above.
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
.)
To navigate an outline tree and print its result.
Read, add, edit PDF outlines and bookmarks
Full code sample which illustrates how to read and edit existing outline items and create new bookmarks using the high-level API.
A PDF document may display a document outline on the screen, allowing the user to navigate interactively from one part of the document to another. The outline consists of a tree-structured hierarchy of Bookmarks (sometimes called outline items), which serve as a "visual table of contents" to display the document's structure to the user.
Each Bookmark has a title that appears on screen, and an Action that specifies what happens when a user clicks on the Bookmark. The typical Action for a user-created Bookmark is to move to another location in the current document — although any Action can be specified.
Did you find this helpful?
Trial setup questions?
Ask experts on DiscordNeed other help?
Contact SupportPricing or product questions?
Contact Sales