PdfLoader


interface PdfLoader

Known direct subclasses
SandboxedPdfLoader

A PdfLoader implementation that opens PDF documents through a sandboxed Android service.


Provides an abstraction for asynchronously opening PDF documents from a Uri. Implementations of this interface are responsible for handling the retrieval, decryption (if necessary), and creation of a PdfDocument representation.

Summary

Public functions

suspend PdfDocument
openDocument(uri: Uri, password: String?)

Asynchronously opens a PDF document from the specified Uri.

Public functions

openDocument

suspend fun openDocument(uri: Uri, password: String? = null): PdfDocument

Asynchronously opens a PDF document from the specified Uri.

Parameters
uri: Uri

The URI of the PDF document to open.

password: String? = null

(Optional) The password to unlock the document if it is encrypted.

Returns
PdfDocument

The opened PdfDocument.

Throws
androidx.pdf.PdfPasswordException

If the provided password is incorrect.

java.io.IOException

If an error occurs while opening the document.