Some test text!

menu
search

User bookmarks list

This tutorial only applies to Xamarin.iOS. See Xamarin.Android equivalent here.

The PTBookmarkViewController class shows a list of user-defined bookmarks that can be used to navigate through the document. The user-defined bookmarks are PDFTron 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.

Bookmark view controller

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

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

var bookmarkViewController = new pdftron.PDF.Controls.PTBookmarkViewController (mPdfViewCtrl);
bookmarkViewController.BookmarkViewControllerBookmarkSelected += (sender, e) => {
    // perform custom action
    this.DismissViewController (true, null);
};
bookmarkViewController.BookmarkViewControllerDidCancel += (object sender, EventArgs e) => {
    this.DismissViewController (true, null);
};

var navigationController = new UINavigationController (bookmarkViewController);
if (UserInterfaceIdiomIsPad)
{
    navigationController.ModalPresentationStyle = UIModalPresentationStyle.Popover;
    navigationController.PopoverPresentationController.BarButtonItem = bookmarksButton;
}

this.PresentViewController (navigationController, true, null);
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 PopoverPresentationController 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.

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