ContentResolverDataProvider

Data provider for opening PDF documents directly from a ContentProvider using Android's content resolver framework. PSPDFKit internally uses this data provider when loading a document from an Uri that uses the content:// or file:// scheme.

Creates the data provider for loading a document from the given content provider uri.

Parameters

uri

A content provider URI with supported scheme (content:// or file://).

Constructors

Link copied to clipboard
constructor(uri: Uri)

Types

Link copied to clipboard
object Companion

Companion object containing constants for ContentResolverDataProvider.

Properties

Link copied to clipboard
open override val size: Long
Link copied to clipboard
open override val title: String?
Link copied to clipboard
open override val uid: String

Functions

Link copied to clipboard
open override fun canWrite(): Boolean

Returns true as this data provider supports writing.

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

Returns 0 as this Parcelable has no special contents.

Link copied to clipboard
open override fun finishWrite(): Boolean

Completes the write operation and flushes all data.

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

Returns the size of the document in bytes, or DataProvider.FILE_SIZE_UNKNOWN if the size cannot be determined.

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

Returns the display title of the document, derived from the content provider metadata.

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

Returns the unique identifier for this data provider, which is the URI string.

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

Returns the content provider URI this data provider was created with.

Link copied to clipboard
open override fun startWrite(writeMode: WritableDataProvider.WriteMode): Boolean

Begins a write operation to the content provider URI.

Link copied to clipboard
open override fun supportsAppending(): Boolean

Checks whether the content provider supports appending data to an existing file.

Link copied to clipboard
open override fun write(data: ByteArray): Boolean

Writes data to the content provider URI.

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

Writes the content provider URI to the parcel for serialization.