newInstance

open fun newInstance(@NonNull documentUri: Uri, @NonNull configuration: PdfConfiguration): PdfFragment

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

Return

New instance of fragment that can be attached to view hierarchy.

Parameters

configuration

Configuration for PDF display generated with .


open fun newInstance(@NonNull documentUri: Uri, @Nullable password: String, @NonNull configuration: PdfConfiguration): PdfFragment

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

Return

New instance of fragment that can be attached to view hierarchy.

Parameters

password

Document password, can be null.

configuration

Configuration for PDF display generated with .


open fun newInstance(@NonNull documentUri: Uri, @Nullable password: String, @Nullable contentSignature: String, @NonNull configuration: PdfConfiguration): PdfFragment

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

Return

New instance of fragment that can be attached to view hierarchy.

Parameters

password

Document password, can be null.

contentSignature

Content signature, can be null.

configuration

Configuration for PDF display generated with .


open fun newInstance(@NonNull documentUris: List<Uri>, @NonNull configuration: PdfConfiguration): PdfFragment

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

Return

New instance of fragment that can be attached to view hierarchy.

Parameters

configuration

Configuration for PDF display generated with .


open fun newInstance(@NonNull documentUris: List<Uri>, @Nullable documentPasswords: List<String>, @NonNull configuration: PdfConfiguration): PdfFragment

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

Return

New instance of fragment that can be attached to view hierarchy.

Parameters

documentPasswords

A list of corresponding passwords for the given documents.

configuration

Configuration for PDF display generated with .


open fun newInstance(@NonNull documentUris: List<Uri>, @Nullable documentPasswords: List<String>, @Nullable documentContentSignatures: List<String>, @NonNull configuration: PdfConfiguration): PdfFragment

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

Return

New instance of Fragment that can be attached to view hierarchy.

Parameters

documentPasswords

A list of corresponding passwords for the given documents.

documentContentSignatures

A list of corresponding document content signatures for the given documents.

configuration

Configuration for PDF display generated with .


open fun newInstance(@NonNull source: DataProvider, @Nullable password: String, @NonNull configuration: PdfConfiguration): PdfFragment

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

Return

New instance of fragment that can be attached to view hierarchy.

Parameters

source

Instance of DataProvider to load data from. Note: this object WILL NOT BE RETAINED ON RECREATION unless it implements Parcelable interface.

password

Document password, can be null.

configuration

Configuration for PDF display generated with .


open fun newInstance(@NonNull source: DataProvider, @Nullable password: String, @Nullable contentSignature: String, @NonNull configuration: PdfConfiguration): PdfFragment

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

Return

New instance of fragment that can be attached to view hierarchy.

Parameters

source

Instance of DataProvider to load data from. Note: this object WILL NOT BE RETAINED ON RECREATION unless it implements Parcelable interface.

password

Document password, can be null.

contentSignature

Content signature, can be null.

configuration

Configuration for PDF display generated with .


open fun newInstance(@NonNull document: PdfDocument, @NonNull configuration: PdfConfiguration): PdfFragment

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

Return

New instance of fragment that can be attached to view hierarchy.

Parameters

document

An already opened instance of a PdfDocument object.

configuration

Configuration for PDF display generated with .


open fun newInstance(@NonNull fragment: PdfFragment, @NonNull configuration: PdfConfiguration): PdfFragment

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.

Return

New instance of fragment that can be attached to view hierarchy.

Parameters

fragment

An already displayed PdfFragment to copy the state from.

configuration

Configuration for PDF display generated with .