public final class

InstantDocumentDescriptor

extends Object
java.lang.Object
   ↳ com.pspdfkit.instant.client.InstantDocumentDescriptor

Class Overview

Descriptor/handle for InstantPdfDocument that provides methods for downloading/opening instant documents.

Each descriptor describes a single Instant document layer defined by the Document id and layer name. Both of these are encoded in the JWT used for authentication provided via openDocumentAsync(String) or downloadDocumentAsync(String).

Summary

Public Methods
synchronized Flowable<InstantProgress> downloadDocumentAsync(String jwt)
Downloads document from instant server asynchronously.
String getDocumentId()
Document Id of the managed document.
String getJwt()
JWT used to authenticate access to the document.
String getLayerName()
Name of the managed document layer.
String getUserId()
Id of the user the layer managed by the handle belongs to.
boolean isDownloaded()
Check whether document is already downloaded.
InstantPdfDocument openDocument(String jwt)
Downloads and opens document from instant server (synchronously).
Single<InstantPdfDocument> openDocumentAsync(String jwt)
Downloads and opens document from instant server asynchronously.
void removeLocalStorage()
Removes local storage for this layer.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public synchronized Flowable<InstantProgress> downloadDocumentAsync (String jwt)

Downloads document from instant server asynchronously.

Scheduler:
downloadDocumentAsync does not operate by default on a particular Scheduler.

Parameters
jwt JWT used to authenticate access to the document.
Returns
  • Flowable chain emitting download progress updates.

public String getDocumentId ()

Document Id of the managed document.

Returns
  • String identifier uniquely identifying this document on the Instant server.

public String getJwt ()

JWT used to authenticate access to the document.

Returns
  • Currently used JWT for authenticating access to the document.

public String getLayerName ()

Name of the managed document layer.

Returns
  • String identifier identifying document layer.

public 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.

public boolean isDownloaded ()

Check whether document is already downloaded.

public InstantPdfDocument openDocument (String jwt)

Downloads and opens document from instant server (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.

public Single<InstantPdfDocument> openDocumentAsync (String jwt)

Downloads and opens document from instant server asynchronously.

Scheduler:
openDocumentAsync does not operate by default on a particular Scheduler.

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.

public void removeLocalStorage ()

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