getAsBase64StringAsync Method
In This Topic
Sends an asynchronous request to save images from this image collection to an image file and return file data as a Base64 string.
Syntax
var instance = new Vintasoft.Twain.WebAcquiredImageCollectionJS(twainDeviceManager);
var value; // Type: any
// Parameters
var fileName; // Type: string
var imageIds; // Type: string[]
var successFunc; // Type: function
var errorFunc; // Type: function
value = instance.getAsBase64StringAsync(fileName, imageIds, successFunc, errorFunc);
function getAsBase64StringAsync(
: string,
: string[],
: Function,
: Function
) : any;
Parameters
- fileName
- A name of image file, which should be created.
- imageIds
- An array of strings, which define identifiers of images.
- successFunc
- A function that will be executed if request is executed successfully. Function prototype: "successFunc(imageCollection, fileName, imageIds, data.imageFileAsBase64String)", where 'imageCollection' parameter is an instance of WebAcquiredImageCollectionJS class, 'fileName' parameter is name of created image file, 'imageIds' parameter is array of image identifiers, 'imageFileAsBase64String' parameter is file data as a base64-string string.
- errorFunc
- A function that will be executed if request is failed. Function prototype: "errorFunc(imageCollection, errorMessage)", where 'imageCollection' parameter is an instance of WebAcquiredImageJS class, 'errorMessage' parameter is string that describes error.
Exceptions
Exception | Description |
| Thrown if imageIds is not an array of strings OR images are not retrieved. |
Remarks
This function sends an asynchronous request to save images from this image collection to an image file. If you want to use synchronous request instead of asynchronous request, please use WebAcquiredImageCollectionJS.getAsBase64String function.
Browser Compatibility
See Also