Package com.pspdfkit

Object PSPDFKit

    • Constructor Detail

    • Method Detail

      • initialize

        @Synchronized() final static Unit initialize(Context context, String licenseKey)

        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.
      • clearCaches

         final static Unit clearCaches()

        Clears pageBitmap memory cache to free memory.

      • isLocalFileUri

         final Boolean isLocalFileUri(Context context, Uri uri)

        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.

        Parameters:
        context - Context for analyzing the uri.
        uri - Uri pointing to a PDF document.
        Returns:

        true if PSPDFKit can access the file directly, or false if it needs to use a content resolver for access.

      • isOpenableUri

         final static Boolean isOpenableUri(Context context, Uri uri)

        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.

        Parameters:
        context - Application context.
        uri - Android file URI.
        Returns:

        true if the document can be directly opened.

      • isInitialized

         final static Boolean isInitialized()

        Returns true if PSPDFKit is initialized and ready to use.

        Returns:

        true if PSPDFKit was initialized.

      • addAnalyticsClient

         final static Boolean addAnalyticsClient(AnalyticsClient client)

        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.

        Parameters:
        client - An AnalyticsClient to add.
        Returns:

        true if the client was successfully added, otherwise false.

      • removeAnalyticsClient

         final Boolean removeAnalyticsClient(AnalyticsClient client)

        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.

        Parameters:
        client - An AnalyticsClient to remove.
        Returns:

        true if the client was successfully removed, otherwise false.

      • setNativeCrashDumpPath

         final Unit setNativeCrashDumpPath(String path)

        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.

        Parameters:
        path - Path for native crash dumps, must be writable.
      • setLocalizationListener

         final Unit setLocalizationListener(LocalizationListener localizationListener)

        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.

        Parameters:
        localizationListener - new localization listener.
      • setApplicationPolicy

         final static Unit setApplicationPolicy(ApplicationPolicy applicationPolicy)

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

        Parameters:
        applicationPolicy - New policy to be set.