VintaSoft Twain .NET SDK 15.0: Documentation for Web developer
Vintasoft.Twain Namespace / WebTwainDeviceJS type / getSupportedCapabilities Methods / getSupportedCapabilities(number) Property
Syntax Exceptions Remarks Example BrowserCompatibility SeeAlso
In This Topic
    getSupportedCapabilities(number) Method
    In This Topic
    Returns information about all capabilities supported by TWAIN device.
    Syntax
    var instance = new Vintasoft.Twain.WebTwainDeviceJS(deviceName, productFamily, manufacturer, driverVersion, twainVersion, deviceManager, is64Bit);
    
    var value; // Type: Vintasoft.Twain.WebTwainCapabilityInfoJS[]
    
    // Parameters
    var usageMode; // Type: number
    
    value = instance.getSupportedCapabilities(usageMode);
    
    
    function getSupportedCapabilities(
    usageMode
    An integer value, which defines usage mode of TWAIN device capability.
    : number
    ) : WebTwainCapabilityInfoJS[];

    Parameters

    usageMode
    An integer value, which defines usage mode of TWAIN device capability.

    Return Value

    An array of instances of WebTwainCapabilityInfoJS class.
    Exceptions
    ExceptionDescription
    Thrown if argument has wrong type OR device is not opened OR error occurs during getting information about supported device capabilities.
    Remarks

    This function sends a synchronous request to get information about all capabilities supported by TWAIN device. If you want to use asynchronous request instead of synchronous request, please use WebTwainDeviceJS.getSupportedCapabilitiesAsync function.

    Example

    // Gets information about supported capabilities of opened TWAIN device.
    function getSupportedTwainDeviceCapabilities() {
        try {
            // specify that "Get" usage mode must be used for getting information about capabilities
            var usageMode = new Vintasoft.Twain.WebTwainDeviceCapabilityUsageModeEnumJS("Get");
            // get information about capabilities of opened TWAIN device
            var twainCapInfos = twainDevice.getSupportedCapabilities(usageMode);
            // for each capability
            for (var i = 0; i < twainCapInfos.length; i++) {
                var twainCapInfo = twainCapInfos[i];
                // output information about capability identifier, name and current value to the log
                console.log("Capability ID: " + twainCapInfo.get_Id() + " Capability name: " + twainCapInfo.get_Name() + " Current value: " + twainCapInfo.get_CurrentValue());
            }
        }
        catch (ex) {
            alert(ex);
        }
    }
    

    Browser Compatibility
    9
    See Also