initialize

Initializes PSPDFKit with a license key. This must be called before any other call to methods in this class.

This method can safely be called multiple times and is not needed when using com.pspdfkit.ui.PdfFragment or com.pspdfkit.ui.PdfActivity.

Parameters

context

Application context.

options

Extra initialization options, for example license key string. See InitializationOptions. Use null for trial purposes.

Throws

If license is not valid for this app.

If current device isn't compatible with PSPDFKit (e.g. Android < 5.0 or wrong ABI) or if some other error occurred.

If RxAndroid or RxJava dependencies are missing in the containing app.


fun initialize(context: Context, licenseKey: String)

Helper for the main initialise method. Useful if you only want to initialise with a license key and want to leave other options as default.

Parameters

context

Application context.

licenseKey

A valid PSPDFKit license key.


fun initialize(context: Context, licenseKey: String?, fontPaths: List<String>, hybridTechnology: String?)

Deprecated

v2024.2: Will be removed in 2025.

Replace with

initialize(context, options: InitializationOptions?)

Initializes PSPDFKit with a license key. This must be called before any other call to methods in this class.

This method can safely be called multiple times and is not needed when using com.pspdfkit.ui.PdfFragment or com.pspdfkit.ui.PdfActivity.

Parameters

context

Application context.

licenseKey

PSPDFKit license key or null for trial.

fontPaths

Additional paths to lookup fonts.

hybridTechnology

Specifies the Hybrid technology where PSPDFKit is supposed to be working on, or null if PSPDFKit runs in a native Android project.


fun initialize(context: Context, licenseKey: String?, fontPaths: List<String>)

Deprecated

v2024.2: Will be removed in 2025.

Replace with

initialize(context, options: InitializationOptions?)

Initializes PSPDFKit with a license key. This must be called before any other call to methods in this class.

Parameters

context

Application context.

licenseKey

PSPDFKit license key or null for trial.

fontPaths

Additional paths to lookup fonts.


fun initialize(context: Context, licenseKey: String?, applicationPolicy: ApplicationPolicy)

Deprecated

v2024.2: Will be removed in 2025.

Replace with

initialize(context, options: InitializationOptions?)

Initializes PSPDFKit with a license key and a specific application policy. This must be called before any other call to methods in this class.

Parameters

context

Application context.

licenseKey

PSPDFKit license key or nullfor trial.

applicationPolicy

Application policy.


fun initialize(context: Context, licenseKey: String?, applicationPolicy: ApplicationPolicy, fontPaths: List<String>)

Deprecated

v2024.2: Will be removed in 2025.

Replace with

initialize(context, options: InitializationOptions?)

Initializes PSPDFKit with a license key and a specific application policy. This must be called before any other call to methods in this class.

Parameters

context

Application context.

licenseKey

PSPDFKit license key or null for trial.

applicationPolicy

Application policy.

fontPaths

Additional paths used to lookup fonts.