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

    Parameters

    twainCapabilityIds
    An array of integer values, which define identifiers of device capabilities.
    usageMode
    An integer value, which defines usage mode of 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 TWAIN device capabilities. If you want to use asynchronous request instead of synchronous request, please use WebTwainDeviceJS.getCapabilitiesAsync function.

    Example

    // Gets information about PixelType, XResolution and YResolution capabilities of opened TWAIN device.
    function getSupportedTwainDeviceCapabilities() {
        try {
            // specify that we need to get current value of TWAIN device capability
            var capUsageModeId = 4;
            // get information about capabilities of opened TWAIN device
            var twainCapInfos = twainDevice.getCapabilities([257, 4376, 4377], capUsageModeId);
            // 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