Introduction
MuPDF Android App Kit
MuPDF iOS App Kit
Download App Kit

PDF Table of Contents

Overview

Not all PDF documents will have a Table of Contents, to check to see if the current document instance contains a Table of Contents an application developer should call the isTOCEnabled method once the document has fully loaded.

Kotlin
val hasTOC:Boolean = documentView.isTOCEnabled

if (hasTOC) {
    // enable UI (e.g. button/gesture) responsible for invoking TOC display
}
Java
boolean hasTOC = documentView.isTOCEnabled();

if (hasTOC) {
    // enable UI (e.g. button/gesture) responsible for invoking TOC display
}

In order to show the Table of Contents UI an application developer simply needs to call the tableOfContents method as follows:

Kotlin
documentView.tableOfContents()
Java
documentView.tableOfContents();

table-of-contents-ui Table of Contents UI

NOTE
Table of Contents is also known as "Bookmarks"