User bookmark dialog fragment

In this document
chevron_rightListener
chevron_rightRead-only

The UserBookmarkDialogFragment dialog 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 outline dialog fragment guide.

Show user bookmark dialog

To create a new instance of the user bookmark dialog fragment call newInstance() and set the PDFViewCtrl:

UserBookmarkDialogFragment userBookmarkDialogFragment = UserBookmarkDialogFragment.newInstance()
    .setPdfViewCtrl(pdfViewCtrl);
userBookmarkDialogFragment.setStyle(DialogFragment.STYLE_NO_TITLE, R.style.CustomAppTheme);
userBookmarkDialogFragment.show(fragmentManager, "user_bookmarks_dialog");

Listener

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

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