openDocumentAsync

open fun openDocumentAsync(@NonNull context: Context, @NonNull documentUri: Uri): Single<PdfDocument>

Opens a PDF document from an Uri. Remote Uri's are supported and automatically downloaded. If the document being opened is password protected, the returned Single will fail with an InvalidPasswordException. To open password protected documents use openDocumentAsync instead. The returned Single may also fail with a DownloadException if anything happened during the download of a remote Uri.

Return

Observable which returns a single opened document when called successfully

Parameters

context

Application context

documentUri

Uri pointing to the PDF document.

Throws

if PSPDFKit was not initialized with initialize call.


open fun openDocumentAsync(@NonNull context: Context, @NonNull documentUri: Uri, @Nullable password: String): Single<PdfDocument>

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

Return

Observable which returns a single opened document when called successfully

Parameters

context

Application context

documentUri

Uri pointing to the PDF document.

password

PDF document password, may be null.

Throws

if PSPDFKit was not initialized with initialize call.


open fun openDocumentAsync(@NonNull context: Context, @NonNull source: DocumentSource): Single<PdfDocument>

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

Return

Observable which returns a single opened document when called successfully

Parameters

context

Application context

source

DocumentSource of the document.

Throws

if PSPDFKit was not initialized with initialize call.


open fun openDocumentAsync(@NonNull context: Context, @NonNull source: DocumentSource, multithreadedRenderingEnabled: Boolean): Single<PdfDocument>

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

Return

Observable which returns a single opened document when called successfully

Parameters

context

Application context

source

DocumentSource of the document.

multithreadedRenderingEnabled

Whether the multithreaded rendering should be enabled when rendering document pages.

Throws

if PSPDFKit was not initialized with initialize call.