Nutrient 2024.9 migration guide

This guide outlines the changes to Nutrient Android SDK 2024.9.

Breaking API changes

Bookmark list view configuration

We changed how the bookmark list view is configured in PdfOutlineView:

  • We added setBookmarkAddingEnabled(), which, when false, will remove the add button in the bookmark list view bottom bar.

  • We changed setBookmarkEditingEnabled() to only affect the edit button visibility in the bookmark list view bottom bar. Previously, this option affected the add button only.

  • In the PdfActivityConfiguration Builder, we removed the bookmarkEditingEnabled option. You now have to use the APIs listed above.

For example, in PdfActivity, use this:

override fun onDocumentLoaded(document: PdfDocument) {
    super.onDocumentLoaded(document)
    pspdfKitViews.outlineView?.setBookmarkAddingEnabled(false)
    pspdfKitViews.outlineView?.setBookmarkEditingEnabled(false)
}

Or, in your Compose app, use this:

DocumentView(
    documentState,
    modifier = Modifier.fillMaxSize(),
    documentManager = getDefaultDocumentManager(
        documentListener = DefaultListeners.documentListeners(onDocumentLoaded = {
            documentState.documentConnection.pdfActivityViews.outlineView?.setBookmarkAddingEnabled(false)
            documentState.documentConnection.pdfActivityViews.outlineView?.setBookmarkEditingEnabled(false)
        }),

Compose wrapper APIs

We made some changes to DocumentConnection:

  • DocumentConnection#pdfUI is deprecated and has been replaced with our standard CamelCase naming scheme, pdfUi.

  • DocumentConnection#pdfActivityViews has been added to access PSPDFKitViews APIs from the PdfActivity. Refer to the bookmark examples above for details on how to use this.