openDocumentAsync

fun openDocumentAsync(context: Context, documentUri: Uri): Single<ImageDocument>

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

The returned Single may fail with a com.pspdfkit.document.download.exceptions.DownloadException if anything happened during the download of a remote Uri.

Return

Single observable returning an ImageDocument instance if the opening succeeded.

Parameters

context

Application context.

documentUri

Uri pointing to the PDF document.

Throws

com.pspdfkit.exceptions.NutrientNotInitializedException

If PSPDFKit was not initialized with com.pspdfkit.Nutrient.initialize call.


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

The returned Single may fail with a com.pspdfkit.document.download.exceptions.DownloadException if anything happened during the download of a remote Uri.

Return

Single observable returning an ImageDocument instance if the opening succeeded.

Parameters

context

Application context.

source

DocumentSource describing the source of the image document.

Throws

com.pspdfkit.exceptions.NutrientNotInitializedException

If PSPDFKit was not initialized with com.pspdfkit.Nutrient.initialize call.