DocumentDescriptor

Describes a document and its UI state. The DocumentDescriptor is used by the PdfActivity's DocumentCoordinator to handle multiple loaded documents and to manage their state.

Document is represented by the list of parcelable DocumentSources. Descriptor also holds loaded PdfDocument after it's loaded by the DocumentCoordinator. Note that this PdfDocument instance won't be restored after reading from the parcel - it must be loaded again in this case.

Properties

Link copied to clipboard
Creator for Parcelable implementation.
Link copied to clipboard
Custom title that will be displayed in the UI instead of document title.
Link copied to clipboard
The loaded PDF document instance, or null if not yet loaded.
Link copied to clipboard
The list of document sources from which the document is loaded.
Link copied to clipboard
Whether this descriptor represents an image document rather than a PDF.
Link copied to clipboard
The UI state bundle associated with this document.

Functions

Link copied to clipboard
open fun describeContents(): Int
Describes the kinds of special objects contained in this Parcelable instance.
Link copied to clipboard
open fun fromDataProvider(@NonNull dataProvider: DataProvider, @Nullable password: String, @Nullable contentSignature: String): DocumentDescriptor
Creates descriptor for document loaded from data provider.
Link copied to clipboard
open fun fromDataProviders(@NonNull dataProviders: List<DataProvider>, @Nullable passwords: List<String>, @Nullable contentSignatures: List<String>): DocumentDescriptor
Creates descriptor for compound document loaded from data providers.
Link copied to clipboard
Creates descriptor for loaded document.
Link copied to clipboard
Creates descriptor for document loaded from document source.
Link copied to clipboard
Creates descriptor for compound document loaded from document sources.
Link copied to clipboard
open fun fromUri(@NonNull documentUri: Uri): DocumentDescriptor
open fun fromUri(@NonNull documentUri: Uri, @Nullable password: String): DocumentDescriptor
Creates descriptor for document loaded from URI.
Link copied to clipboard
open fun fromUris(@NonNull documentUris: List<Uri>, @Nullable passwords: List<String>, @Nullable contentSignatures: List<String>): DocumentDescriptor
Creates descriptor for compound document loaded from multiple URIs.
Link copied to clipboard
Returns source from which the document should be loaded.
Link copied to clipboard
open fun getTitle(@NonNull context: Context): String
Returns displayable document title.
Link copied to clipboard
open fun getUid(): String
Returns unique document ID.
Link copied to clipboard
Creates descriptor for image document loaded from data provider.
Link copied to clipboard
Creates descriptor for image document loaded from a document source.
Link copied to clipboard
Creates descriptor for image document loaded from URI.
Link copied to clipboard
open fun setTitle(@Nullable title: String)
Sets a custom displayable document title.
Link copied to clipboard
open fun writeToParcel(@NonNull dest: Parcel, flags: Int)
Writes this document descriptor to a Parcel.