PSPDFKit

object PSPDFKit

Main PSPDFKit entry point. Use .initialize to initialize the library if you are not using the com.pspdfkit.ui.PdfActivity or the com.pspdfkit.ui.PdfFragment (which handle initialization on their own).

Properties

Link copied to clipboard
const val VERSION: String

String version of PSPDFKit library.

Functions

Link copied to clipboard

Add a AnalyticsClient to receive analytics events from PSPDFKit. This method will return true if the client was successfully added, or false if it was not added. Usually this happens if the client has already been added previously.

Link copied to clipboard
fun clearCaches(context: Context, clearDiskCache: Boolean)

Clears pageBitmap memory cache to free memory.

Link copied to clipboard

Checks if PSPDFKit is initialized or throws PSPDFKitNotInitializedException if not.

Link copied to clipboard
Link copied to clipboard

Gets all the LicenseFeature that are enabled with the current license.

Link copied to clipboard

Returns The FontManager giving you access to the system fonts.

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

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

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.

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

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

Link copied to clipboard

Returns true if PSPDFKit is initialized and ready to use.

Link copied to clipboard
fun isLocalFileUri(context: Context, uri: Uri): Boolean

Checks whether or not PSPDFKit can extract a local filesystem path from the uri. If this method returns true PSPDFKit can directly access the document on the filesystem, and can thus achieve faster loading speeds. If the method returns false, use .isOpenableUri to check whether PSPDFKit can still use the uri for document access.

Link copied to clipboard

PSPDFKit can only open URIs from content providers that also provide size information. This determines if the document is openable directly from that URI. Note that this will not check if file actually exists.

Link copied to clipboard

Releases PSPDFKit library and all associated caches from memory.

fun release(context: Context)

Releases PSPDFKit library and all associated caches from memory.

Link copied to clipboard

Remove a previously added AnalyticsClient from PSPDFKit. This method will return true if the client was successfully removed, or false if it was not removed. This usually happens if the client was not registered previously.

Link copied to clipboard

Sets application policy for the loaded library. Make sure the library is initialized before calling this method.

Link copied to clipboard

Sets a new LocalizationListener to help with localizing SDK framework strings. WARNING: The localization listener is retained globally, so make sure it does not refer to any Activity context or it WILL leak memory.

Link copied to clipboard

Sets a directory into which native code minidumps will be stored for debugging of native crashes. T he minidumps are stored in Google Breakpad format.