VintaSoft Twain .NET SDK 15.0: Documentation for Web developer
Vintasoft.Twain Namespace / WebTwainDeviceJS type / getCapability Methods / getCapability(Vintasoft.Twain.WebDeviceCapabilityIdEnumJS,Vintasoft.Twain.WebTwainDeviceCapabilityUsageModeEnumJS) Property
Syntax Exceptions Remarks Example BrowserCompatibility SeeAlso
In This Topic
    getCapability(Vintasoft.Twain.WebDeviceCapabilityIdEnumJS,Vintasoft.Twain.WebTwainDeviceCapabilityUsageModeEnumJS) Method
    In This Topic
    Returns information about 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 usageMode; // Type: WebTwainDeviceCapabilityUsageModeEnumJS
    
    value = instance.getCapability(twainCapabilityId, usageMode);
    
    

    Parameters

    twainCapabilityId
    An instance of WebDeviceCapabilityIdEnumJS class.
    usageMode
    An instance of WebTwainDeviceCapabilityUsageModeEnumJS class.

    Return Value

    An instance of WebTwainCapabilityInfoJS class.
    Exceptions
    ExceptionDescription
    Thrown if arguments have wrong types OR device is not opened OR error occurs during getting value of device capability.
    Remarks

    This function sends a synchronous request to get information about TWAIN device capability. If you want to use asynchronous request instead of synchronous request, please use WebTwainDeviceJS.getCapabilityAsync function.

    Example

    // Displays information about pixel type of scanned images for opened TWAIN device.
    function displayPixelType(twainDevice) {
        try {
            // specify that we need to get information about IPixelType capability
            var pixelTypeCap = new Vintasoft.Twain.WebDeviceCapabilityIdEnumJS("IPixelType");
            // specify that we need to get current value of TWAIN device capability
            var capUsageMode = new Vintasoft.Twain.WebTwainDeviceCapabilityUsageModeEnumJS("GetCurrent");
            // get information about current value of PixelType capability of opened TWAIN device
            var pixelTypeCapInfo = twainDevice.getCapability(pixelTypeCap, capUsageMode);
            // write information about current capability value
            console.log("PixelType capability value :" + pixelTypeCapInfo.get_CurrentValue());
        }
        catch (ex) {
            alert(ex);
        }
    }
    

    Browser Compatibility
    9
    See Also