VintaSoft Twain .NET SDK v10.2
Vintasoft.Twain Namespace / WebTwainDeviceJS type / setDeviceCapability Method
Integer value of device capability identifier OR instance of WebDeviceCapabilityIdJS.
New capability value.
Function that will be executed if request is executed successfully.
Here is function prototype "function __success(data)".
The data parameter has the following properties:
Function that will be executed if request is failed.
Here is function prototype "function __error(data)".
The data parameter can be:
  1. An object with following properties:
    • errorMessage (string): Error message.
    • blocked (boolean): Indicates that the requested action is blocked by another request.
    if exception is catched inside web service.
  2. Otherwise, jqXHR object.
In This Topic
    setDeviceCapability Method
    In This Topic
    Sends an asynchronous request to a server for setting the TWAIN device capability.
    Syntax
    var instance = new Vintasoft.Twain.WebTwainDeviceJS(deviceName,
                                                       productFamily,
                                                       manufacturer,
                                                       driverVersion,
                                                       twainVersion,
                                                       deviceManager);
    var value; // Type: any
    
    // Parameters
    var twainCapabilityId; // Type:  object
    var twainCapabilityValue; // Type:  string
    var successFunc; // Type:  object
    var errorFunc; // Type:  object
    
    value = instance.setDeviceCapability(twainCapabilityId, twainCapabilityValue, successFunc, errorFunc);
    function setDeviceCapability( 
       twainCapabilityId : object,
       twainCapabilityValue : string,
       successFunc : object,
       errorFunc : object
    ) : any;

    Parameters

    twainCapabilityId
    Integer value of device capability identifier OR instance of WebDeviceCapabilityIdJS.
    twainCapabilityValue
    New capability value.
    successFunc
    Function that will be executed if request is executed successfully.
    Here is function prototype "function __success(data)".
    The data parameter has the following properties:
    • capability (object): The value of TWAIN device capability.
      Twain device capability is object with the following properties:
      • id (string): The identifier of TWAIN device capability.
      • name (string): The name of TWAIN device capability.
      • value (object): The value (was obtained using the Get mode) of TWAIN device capability.
        Value of TWAIN device capability is object with the following properties:
        • containerType (string): The container type of TWAIN device capability value.
        • valueType (string): The type of TWAIN device capability value.
        • value (string): The current value of TWAIN device capability value.
        • defaultValue (string): The default value of TWAIN device capability value.
        • minValue (string): The minimum value of TWAIN device capability value.
        • maxValue (string): The maximum value of TWAIN device capability value.
        • stepSize (string): The step size of TWAIN device capability value.
        • supportedValues (object): The supported values of TWAIN device capability value.
      • currentValue (object): The curent value (was obtained using the GetCurrent mode) of TWAIN device capability.
      • defaultValue (object): The default value (was obtained using the GetDefault mode) of TWAIN device capability.
    errorFunc
    Function that will be executed if request is failed.
    Here is function prototype "function __error(data)".
    The data parameter can be:
    1. An object with following properties:
      • errorMessage (string): Error message.
      • blocked (boolean): Indicates that the requested action is blocked by another request.
      if exception is catched inside web service.
    2. Otherwise, jqXHR object.
    Browser Compatibility
    9
    5
    11
    5
    See Also