In This Topic
Sends an asynchronous request to open TWAIN/SANE device.
Syntax
var instance = new Vintasoft.Twain.WebTwainDeviceJS(deviceName, productFamily, manufacturer, driverVersion, twainVersion, deviceManager, is64Bit);
var value; // Type: any
// Parameters
var showUI; // Type: boolean
var showIndicators; // Type: boolean
var successFunc; // Type: function
var errorFunc; // Type: function
value = instance.openAsync(showUI, showIndicators, successFunc, errorFunc);
function openAsync(
: boolean,
: boolean,
: Function,
: Function
) : any;
Parameters
- showUI
- True - device UI must be shown; false - device UI must NOT be shown.
- showIndicators
- True - device should show progress indicator during image scan process; false - device should not show progress indicator during image scan process. Default value is true.
- successFunc
- A function that will be executed if request is executed successfully.
Function prototype: "successFunc(twainDevice)", where 'twainDevice' parameter is an instance of WebTwainDeviceJS class.
- errorFunc
- A function that will be executed if request is failed.
Function prototype: "errorFunc(twainDevice, errorMessage)", where 'twainDevice' parameter is an instance of WebTwainDeviceJS class, 'errorMessage' parameter is string that describes error.
Exceptions
Exception | Description |
| Thrown if arguments have wrong type OR another device is opened already OR error occurs during opening the device. |
Remarks
This function sends an asynchronous request to open TWAIN device. If you want to use synchronous request instead of asynchronous request, please use WebTwainDeviceJS.open function.
Browser Compatibility
See Also