Class InstantDocumentDescriptor

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final InternalInstantDocumentDescriptor internal
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • getInternal

        @NonNull() InternalInstantDocumentDescriptor getInternal()

        Returns internal descriptor implementation.

      • getDocumentId

        @NonNull() String getDocumentId()

        Document Id of the managed document.

        Returns:

        String identifier uniquely identifying this document on the Instant Server (PSPDFKit Document Engine).

      • getLayerName

        @NonNull() String getLayerName()

        Name of the managed document layer.

        Returns:

        String identifier identifying document layer.

      • getUserId

        @Nullable() String getUserId()

        Id of the user the layer managed by the handle belongs to.

        May be null for document descriptors that have been instantiated via the legacy API, or with a JWT that does not contain the `user_id` claim.

      • getJwt

        @Nullable() String getJwt()

        JWT used to authenticate access to the document.

        Returns:

        Currently used JWT for authenticating access to the document.

      • isDownloaded

         boolean isDownloaded()

        Check whether document is already downloaded.

      • removeLocalStorage

         void removeLocalStorage()

        Removes local storage for this layer. Document will be invalid after returning from this method.

      • downloadDocumentAsync

        @NonNull() synchronized Flowable<InstantProgress> downloadDocumentAsync(@NonNull() String jwt)

        Downloads document from Instant Server (PSPDFKit Document Engine) asynchronously.

        • Scheduler:
        • downloadDocumentAsync does not operate by default on a particular .
        Parameters:
        jwt - JWT used to authenticate access to the document.
        Returns:

        Flowable chain emitting download progress updates.

      • openDocument

        @NonNull() InstantPdfDocument openDocument(@NonNull() String jwt)

        Downloads and opens document from Instant Server (PSPDFKit Document Engine) (synchronously).

        Parameters:
        jwt - JWT used to authenticate access to the document.
        Returns:

        Single returning opened InstantPdfDocument or error when document could not be downloaded or opened.

      • openDocumentAsync

        @NonNull() Single<InstantPdfDocument> openDocumentAsync(@NonNull() String jwt)

        Downloads and opens document from Instant Server (PSPDFKit Document Engine) asynchronously.

        • Scheduler:
        • openDocumentAsync does not operate by default on a particular .
        Parameters:
        jwt - JWT used to authenticate access to the document.
        Returns:

        Single returning opened InstantPdfDocument or error when document could not be downloaded or opened.

      • getCreatorName

        @Nullable() String getCreatorName()

        Returns the creator name set in the JWT — if any.

        The JWTs issued by your backend server may define a name that should be attached to all annotations created by the bearer of this token under the (optional) key creator_name. In contrast to the user_id, which uniquely identifies the bearer of the JWT as a specific user, and is likely to contain numbers etc. for disambiguation, the creator_name is meant to be human readable. In effect, it is perfectly acceptable for two users (as distinguished by their user_id) to have the same creator name.

        Returns:

        The contents of the optional creator_name claim in the JWT.