Companion

object Companion

Static entry points for obtaining PdfDocument instances.

Functions

Link copied to clipboard

Creates a loader for a single DocumentSource without loading it yet. Internal API.

Link copied to clipboard

Opens a PDF document from a DocumentSource. Remote Uri's are supported and automatically downloaded.

fun openDocument(context: Context, documentUri: Uri, password: String? = null): PdfDocument

Opens a PDF document from a Uri. Remote Uri's are supported and automatically downloaded.

Link copied to clipboard

Opens a PDF document from a DocumentSource. Remote Uri's are supported and automatically downloaded. The returned Single may fail with an InvalidPasswordException when trying to open a password protected document. It may also fail with a DownloadException if anything happened during the download of a remote Uri.

fun openDocumentAsync(context: Context, documentUri: Uri, password: String? = null): Single<PdfDocument>

Opens a PDF document from a Uri. Remote Uri's are supported and automatically downloaded. The returned Single may fail with an InvalidPasswordException if no password or a wrong password was provided for opening the document. It may also fail with a DownloadException if anything happened during the download of a remote Uri.

Link copied to clipboard
fun openDocuments(context: Context, @Size(min = 1) sources: List<DocumentSource>): PdfDocument

Opens multiple PDF documents from a list of sources. The documents will be displayed as a single continuous document. Remote Uri's are supported and automatically downloaded.

Link copied to clipboard
fun openDocumentsAsync(context: Context, @Size(min = 1) sources: List<DocumentSource>): Single<PdfDocument>

Opens multiple PDF documents from a list of Uris. The documents will be displayed as a single continuous document. Remote Uri's are supported and automatically downloaded. The returned Single will fail with an InvalidPasswordException when trying to open a password protected document with no or a wrong password. To specify a password, create the DocumentSource instances using one of the constructors taking a password. It may also fail with a DownloadException if anything happened during the download of a remote Uri.