loadDataAsync()

Description

Loads images from buffer asynchronously and converts them to dcsImage or dcsDocument in DcsBuffer according to the value of mode.

Syntax

(void) loadDataAsync: (NSData *)
data mode: DcsModeEnum mode
successCallback: (onLoadSuccess) onSuccess
failureCallback: (onLoadFailure) onFailure
progressCallback: (onLoadProgress) onProgress

Parameters

data:NSData The data in the buffer in jpg, png or pdf formats.
mode:DcsModeEnum The format for loading images. The values represent whether it's an image or a document.
onSuccess:onLoadSuccess The callback function when this method performs successfully.
onFailure:onLoadFailure The callback function when this method performs unsuccessfully.
onProgress:onLoadProgress The callback function when this method pushes load progress information. This parameter is mainly used for processing multi-page PDFs. This function will be triggered when a number of PDF files are loaded. When false is returned, the loading will be terminated.

Return value

Void

Exceptions

Circumstance Exception thrown
License verification failed. DcsLicenseVerificationFailedException
There is error decoding the data DcsDataFormatInvalidException
Data is nil DcsValueNotValidException
Mode is not DME_DOCUMENT nor DME_IMAGE. DcsValueOutOfRangeException
void (^onLoadSuccess) (id source)
Description This event is triggered when loadDataAsync function is successfully executed.
Parameter source: The source of the data. It represents the file name or the buffer stream loadDataAsync loaded.
void (^onLoadFailure) (id source, DcsException *exp)
Description This event is triggered when loadDataAsync function is not successfully executed.
Parameter source: The source of the data. It represents the file name or the buffer stream loadDataAsync loaded.
exp: The exception loadDataAsync throws.
BOOL (^onLoadProgress) (NSInteger progress)
Description This event is triggered when loadDataAsync function is executing and showing the progress.
Parameter progress: The progress of loading files.
Return When YES is returned, loadDataAsync will keep executing. When NO is returned, loadDataAsync will stop.
Is this page helpful?

Leave a Reply

Your email address will not be published.