For the complete documentation index, see llms.txt. This page is also available as Markdown.

User bookmarks list

Apryse SDK allows you to create a maintain a list of user defined bookmarks.

User-defined bookmarks for Xamarin.Android

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

The UserBookmarkDialogFragment displays a list of user-defined bookmarks that can be used to navigate the document.

Show user bookmark dialog

To show a user bookmark dialog fragment in your activity, create a new instance of UserBookmarkDialogFragment by calling newInstance() and setting the PDFViewCtrl:

Listener

You can set a listener to be notified when a user bookmark is clicked by calling setUserBookmarkListener(UserBookmarkDialogListener).

Read-only

If the document has write access, users can add new user bookmarks using floating action button. To specify whether the document is read-only call setReadOnly(boolean).

Import and export

It is possible to import and export user bookmarks in JSON format. Typical use case is to save and load the user bookmarks JSON from a server.

The user bookmark JSON is a dictionary with page indices as keys and the bookmark title as the values. For example: {"0":"Bookmark 1","2":"Bookmark 2"}. Behaviour is undefined otherwise. Note that the page indices will be 0-indexed similar to XFDF.

User-defined bookmarks for Xamarin.iOS

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 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.

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:

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.

Last updated

Was this helpful?