Companion

object Companion

Factory methods and bundle argument keys for PdfFragment.

Properties

Link copied to clipboard
const val DEFAULT_ZOOM: Float = 1.0f

Default zoom scale.

Link copied to clipboard

Resource ID for the document view within the fragment layout.

Link copied to clipboard

Key for storing the last viewed page index inside the DocumentDataStore of the loaded document. The last viewed page index is only read or written if PdfConfiguration.isLastViewedPageRestorationEnabled is set to true. If page restoration is disabled, the fragment won't access or modify the document store and any previously written value. The value is saved to the store inside onStop.

Link copied to clipboard
const val MAX_ZOOM: Float = 40.0f

Maximum zoom scale. configurable in PdfConfiguration see maxZoomScale.

Link copied to clipboard
const val MIN_ZOOM: Float = 0.9f

Min allowed zoom (before snapping back).

Link copied to clipboard

Bundle argument key for the PDF configuration.

Link copied to clipboard

Bundle argument key for image document source.

Link copied to clipboard

Bundle argument key for document sources.

Functions

Link copied to clipboard
fun newImageInstance(documentUri: Uri, configuration: PdfConfiguration): PdfFragment

Creates and returns a new Fragment to display a converted PDF document from a supported image format.

Link copied to clipboard
fun newInstance(documentUri: Uri, configuration: PdfConfiguration): PdfFragment
fun newInstance(documentUri: Uri, password: String?, configuration: PdfConfiguration): PdfFragment
fun newInstance(documentUri: Uri, password: String?, contentSignature: String?, configuration: PdfConfiguration): PdfFragment

Creates and returns a new Fragment to display a PDF document.

Creates and returns a new Fragment to display a PDF document from an already opened PdfDocument instance. This will not reload the document.

Creates and returns a new Fragment to display a PDF document from an PdfFragment. This will copy the state of the given Fragment while applying the new configuration.

fun newInstance(documentUris: List<Uri>, configuration: PdfConfiguration): PdfFragment
fun newInstance(documentUris: List<Uri>, documentPasswords: List<String>?, configuration: PdfConfiguration): PdfFragment
fun newInstance(documentUris: List<Uri>, documentPasswords: List<String>?, documentContentSignatures: List<String>?, configuration: PdfConfiguration): PdfFragment

Creates and returns a new Fragment to display passed list of PDF documents as a single compound document.

fun newInstance(source: DataProvider, password: String?, configuration: PdfConfiguration): PdfFragment

Creates and returns a new Fragment to display a PDF document from a custom data source.

fun newInstance(source: DataProvider, password: String?, contentSignature: String?, configuration: PdfConfiguration): PdfFragment

Creates and returns a new Fragment to display a PDF document from a custom data source

Link copied to clipboard

Creates and returns a new Fragment to display a PDF document from the given DocumentSources.

Link copied to clipboard
fun newInstanceFromSources(sources: List<DataProvider>, passwords: List<String>?, contentSignatures: List<String>?, configuration: PdfConfiguration): PdfFragment

Creates and returns a new Fragment to display a PDF document from a custom data source as a compound document.