PSPDFKit 2024.2 Migration Guide

This guide outlines the changes to PSPDFKit for Android 2024.2.

Breaking API Changes

PSPDFKitInitializationProvider was changed to InitializationProvider and moved to a different package, and com.pspdfkit is now com.pspdfkit.initialization.

Additionally, the Jetpack Compose package has been changed. Refer to the Compose Package Structure section for more information.

Deprecations and New APIs

Our old initialize methods in the top-level PSPDFKit class have been deprecated in favor of a single initialize method that takes Context and InitializationOptions.

The following changes have been made:

Compose Package Structure

We updated our package structure for multiple files related to Jetpack Compose support.

The files that were accessible before on the com.pspdfkit.jetpack.compose package will be now accessible on new paths, such as com.pspdfkit.jetpack.compose.components.

This is done to better organize the files and make it easier to find the required files.

The files are now organized in the following structure:

  • Components — This contains all the independent Compose components that can be used to build a custom UI for PSPDFKit.

  • Interactors — This contains all the files that can be used to interact with the DocumentView.

  • Views — This contains the composable views that can be used to display PDFs.

  • Utilities — This contains classes that are used to provide extra functionality.

The new structure looks as follows:

└── 📁compose
    └── 📁components
        └── MainToolbar.kt
    └── 📁interactors
        └── DefaultListeners.kt
        └── DocumentConnection.kt
        └── DocumentListener.kt
        └── DocumentManager.kt
        └── DocumentState.kt
    └── 📁utilities
        └── ExperimentalPSPDFKitApi.kt
        └── NonFragmentActivityException.kt
    └── 📁views
        └── DocumentView.kt
        └── ImageDocumentView.kt