PdfLoader


public 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 methods

abstract @NonNull PdfDocument
openDocument(@NonNull Uri uri, String password)

Asynchronously opens a PDF document from the specified Uri.

Public methods

openDocument

abstract @NonNull PdfDocument openDocument(@NonNull Uri uri, String password)

Asynchronously opens a PDF document from the specified Uri.

Parameters
@NonNull Uri uri

The URI of the PDF document to open.

String password

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

Returns
@NonNull 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.