importDocumentJsonAsync

fun importDocumentJsonAsync(document: PdfDocument, dataProvider: ERROR CLASS: Symbol not found for DataProvider): Completable

Deprecated

Use the suspend importDocumentJson API instead.

Replace with

DocumentJsonFormatter.importDocumentJson(document, dataProvider)

Asynchronously imports a document JSON and applies its changes to the given document. The JSON has to be provided by the given dataProvider. Deserialization will start upon subscribing to the Completable returned by this method. The returned completable does not operate on any particular scheduler. If you want to run the deserialization process on a background thread, consider calling Completable.subscribeOn on the completable before subscribing.

The returned completable will emit a DocumentJsonFormatterException when encountering an unexpected error while importing the JSON.

Importing JSON to compound documents is not supported. This method will throw an exception if called with a compound document (i.e. a document having more than one document source).

Return

A Completable that will start the JSON import once its Completable.subscribe method is called.

Parameters

document

The PdfDocument to which the JSON should be imported. This must not be a compound document.

dataProvider

The com.pspdfkit.document.providers.DataProvider which serves the document JSON.

See also

Throws

if trying to import document JSON created with a different document, or other error occurs while importing.