AssetDataProvider

Data provider for opening PDF documents directly from the app's assets.

Default constructor taking the assetName of a document. The filename/path needs to be relative to the asset directory.

Parameters

assetName

Filename of the asset in the application assets folder.

Constructors

Link copied to clipboard
constructor(assetName: String)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun describeContents(): Int
Link copied to clipboard
open override fun getSize(): Long

Return the actual file size of the PDF document which is provided by this data provider. If the data provider can't determine the correct file size (e.g. in case of an error) this method has to return FILE_SIZE_UNKNOWN.

Link copied to clipboard
open override fun getTitle(): String

Displayable document title to be used if PDF document does not contain metadata. For example, for file-based providers this should return the filename. `.pdf` extensions will be stripped automatically.

Link copied to clipboard
open override fun getUid(): String

Unique document identifier used in all caching processes in PSPDFKit. Must be equal or shorter than 50 chars. This method must be implemented for caching to work properly.

Link copied to clipboard
open override fun getUri(): Uri

Returns the Uri from which this provided was created.

Link copied to clipboard
open override fun writeToParcel(dest: Parcel, flags: Int)