VintaSoft Twain .NET SDK 15.0: Documentation for Web developer
Vintasoft.Twain Namespace / WebTwainDeviceJS type / getCapabilities Methods / getCapabilities(Vintasoft.Twain.WebDeviceCapabilityIdEnumJS[]) Property
Syntax Exceptions Remarks Example BrowserCompatibility SeeAlso
In This Topic
    getCapabilities(Vintasoft.Twain.WebDeviceCapabilityIdEnumJS[]) Method
    In This Topic
    Returns information about TWAIN device capabilities. Function gets information about capabilities using Get usage mode.
    Syntax
    var instance = new Vintasoft.Twain.WebTwainDeviceJS(deviceName, productFamily, manufacturer, driverVersion, twainVersion, deviceManager, is64Bit);
    
    var value; // Type: Vintasoft.Twain.WebTwainCapabilityInfoJS
    
    // Parameters
    var twainCapabilityIds; // Type: WebDeviceCapabilityIdEnumJS[]
    
    value = instance.getCapabilities(twainCapabilityIds);
    
    
    function getCapabilities(
    twainCapabilityIds
    An array of instances of WebDeviceCapabilityIdEnumJS class.
    : WebDeviceCapabilityIdEnumJS[]
    ) : WebTwainCapabilityInfoJS;

    Parameters

    twainCapabilityIds
    An array of instances of WebDeviceCapabilityIdEnumJS class.

    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 {
            var pixelTypeCap = new Vintasoft.Twain.WebDeviceCapabilityIdEnumJS("IPixelType");
            var xResCap = new Vintasoft.Twain.WebDeviceCapabilityIdEnumJS("IXResolution");
            var yResCap = new Vintasoft.Twain.WebDeviceCapabilityIdEnumJS("IYResolution");
            // get information about capabilities of opened TWAIN device
            var twainCapInfos = twainDevice.getCapabilities([pixelTypeCap, xResCap, yResCap]);
            // 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