VintaSoft Twain .NET SDK 15.0: Documentation for Web developer
Vintasoft.Twain Namespace / WebTwainDeviceJS type / setCapabilityAsync Methods / setCapabilityAsync(number,string,function,function) Property
Syntax Exceptions Remarks BrowserCompatibility SeeAlso
In This Topic
    setCapabilityAsync(number,string,function,function) Method
    In This Topic
    Sends an asynchronous request to set value of TWAIN device capability.
    Syntax
    var instance = new Vintasoft.Twain.WebTwainDeviceJS(deviceName, productFamily, manufacturer, driverVersion, twainVersion, deviceManager, is64Bit);
    
    var value; // Type: any
    
    // Parameters
    var twainCapabilityId; // Type: number
    var twainCapabilityValue; // Type: string
    var successFunc; // Type: function
    var errorFunc; // Type: function
    
    value = instance.setCapabilityAsync(twainCapabilityId, twainCapabilityValue, successFunc, errorFunc);
    
    
    function setCapabilityAsync(
    twainCapabilityId
    An identifier of TWAIN device capability as a number.
    : number,
    twainCapabilityValue
    A string that represents value that should be set to the TWAIN device capability.
    : string,
    successFunc
    A function that will be executed if request is executed successfully. Function prototype: "successFunc(twainDevice, capInfo)", where 'twainDevice' parameter is an instance of WebTwainDeviceJS class, 'capInfo' parameter is object that contains information about TWAIN device capabilities.
    : Function,
    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.
    : Function
    ) : any;

    Parameters

    twainCapabilityId
    An identifier of TWAIN device capability as a number.
    twainCapabilityValue
    A string that represents value that should be set to the TWAIN device capability.
    successFunc
    A function that will be executed if request is executed successfully. Function prototype: "successFunc(twainDevice, capInfo)", where 'twainDevice' parameter is an instance of WebTwainDeviceJS class, 'capInfo' parameter is object that contains information about TWAIN device capabilities.
    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
    ExceptionDescription
    Thrown if arguments have wrong types OR device is not opened OR error occurs during setting value of device capability.
    Remarks

    This function sends an asynchronous request to set value of TWAIN device capability. If you want to use synchronous request instead of asynchronous request, please use WebTwainDeviceJS.setCapability function.

    Browser Compatibility
    9
    See Also