Some test text!

Hamburger Icon

Xamarin / Guides

Document outline in Xamarin

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

The OutlineDialogFragment displays a document outline (containing PDF Bookmarks that can be used to navigate the PDF document by selecting a bookmark item.

Outline dialog

Show outline dialog

To show an outline dialog fragment in your activity, create a new instance of OutlineDialogFragment by calling newInstance() and setting the PDFViewCtrl:

fun showBookmarksDialog(fragmentManager: FragmentManager, pdfViewCtrl: PDFViewCtrl): BookmarksDialogFragment {
    var bookmarksDialog = pdftron.PDF.Dialog.BookmarksDialogFragment.NewInstance();
    List<DialogFragmentTab> tabs = new List<DialogFragmentTab>();
    var outlineDialog = new DialogFragmentTab(
        Java.Lang.Class.FromType(typeof(OutlineDialogFragment)), BookmarksTabLayout.TagTabOutline, null, "Outline", "Bookmarks Dialog", null);
    bookmarksDialog.SetStyle((int)DialogFragmentStyle.NoTitle, Resource.Style.PDFTronAppTheme);
    bookmarksDialog.Show(fragmentManager, "bookmarks_dialog");
    return bookmarksDialog;

You can also set the current bookmark using setCurrentBookmark(Bookmark).


You can set a listener to be notified when an item in an OutlineDialogFragment is clicked by calling setOutlineDialogListener(OutlineDialogListener).

Get the answers you need: Chat with us