Checking for Device Compatibility

You can include PSPDFKit into applications which will be distributed to devices not supported by PSPDFKit. In that case PSPDFKit.initialize() will throw a PSPDFInitializationFailedException which you must catch and handle appropriately.

Copy
1
2
3
4
5
try {
    PSPDFKit.initialize(context, LICENSE)
} catch (e : PSPDFInitializationFailedException) {
    Log.e(LOG_TAG, "Current device is not compatible with PSPDFKit!")
}
Copy
1
2
3
4
5
try {
    PSPDFKit.initialize(context, LICENSE);
} catch (PSPDFInitializationFailedException e) {
    Log.e(LOG_TAG, "Current device is not compatible with PSPDFKit!");
}