Some test text!

menu
User bookmarkskeyboard_arrow_down

User bookmarks list

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

User-defined bookmarks in Xamarin

This tutorial only applies to Xamarin.Android. See Xamarin.iOS equivalent here.
User-defined bookmarks are a PDFTron specific feature that may not show in other PDF viewer applications. If you want to manage PDF bookmarks so that they can be processed in other standard PDF viewers, see the document outline guide.

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

User bookmark dialog

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

var bookmarkDialog = UserBookmarkDialogFragment.NewInstance();
bookmarkDialog.SetPdfViewCtrl(mPdfViewCtrl);
bookmarkDialog.UserBookmarkClicked += (sender, e) =>
{
    Console.WriteLine("UserBookmarkClicked on page: " + e.PageNum);
    mPdfViewCtrl.SetCurrentPage(e.PageNum);
    bookmarkDialog.Dismiss();
};
bookmarkDialog.SetStyle((int)DialogFragmentStyle.NoTitle, Resource.Style.CustomAppTheme);
bookmarkDialog.Show(this.SupportFragmentManager, "bookmark_list_dialog");

linkListener

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

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

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

// import
BookmarkManager.ImportPdfBookmarks(PDFViewCtrl, String)
// export
BookmarkManager.ExportPdfBookmarks(PDFDoc)

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.