VintaSoft Twain .NET SDK 15.0: Documentation for Web developer
Vintasoft.Twain Namespace / WebTwainDeviceJS type / setCapability Methods / setCapability(Vintasoft.Twain.WebDeviceCapabilityIdEnumJS,string) Property
Syntax Exceptions Remarks Example BrowserCompatibility SeeAlso
In This Topic
    setCapability(Vintasoft.Twain.WebDeviceCapabilityIdEnumJS,string) Method
    In This Topic
    Sets value of TWAIN device capability.
    Syntax
    var instance = new Vintasoft.Twain.WebTwainDeviceJS(deviceName, productFamily, manufacturer, driverVersion, twainVersion, deviceManager, is64Bit);
    
    var value; // Type: Vintasoft.Twain.WebTwainCapabilityInfoJS
    
    // Parameters
    var twainCapabilityId; // Type: WebDeviceCapabilityIdEnumJS
    var twainCapabilityValue; // Type: string
    
    value = instance.setCapability(twainCapabilityId, twainCapabilityValue);
    
    
    function setCapability(
    twainCapabilityId
    An identifier of TWAIN device capability as an instance of WebDeviceCapabilityIdEnumJS class.
    : WebDeviceCapabilityIdEnumJS,
    twainCapabilityValue
    A string that represents value that should be set to the TWAIN device capability.
    : string
    ) : WebTwainCapabilityInfoJS;

    Parameters

    twainCapabilityId
    An identifier of TWAIN device capability as an instance of WebDeviceCapabilityIdEnumJS class.
    twainCapabilityValue
    A string that represents value that should be set to the TWAIN device capability.

    Return Value

    An instance of WebTwainCapabilityInfoJS class.
    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 a synchronous request to set value of TWAIN device capability. If you want to use asynchronous request instead of synchronous request, please use WebTwainDeviceJS.setCapabilityAsync function.

    Example

    // Changes page size of scanned images for opened TWAIN device.
    function setPageSize(twainDevice, pageSizeValue) {
        try {
            // set page size of scanned images
            var pageSizeCapInfo = twainDevice.setCapability(new Vintasoft.Twain.WebDeviceCapabilityIdEnumJS("ISupportedSizes"), pageSizeValue);
        }
        catch (ex) {
            alert(ex);
        }
    }
    

    Browser Compatibility
    9
    See Also