VintaSoft Twain .NET SDK 15.4: Documentation for Web developer
Vintasoft.Twain Namespace / WebTwainDeviceJS type / setCapability Methods / setCapability(Vintasoft.Twain.WebTwainDeviceCapabilityIdEnumJS,string) Property
Syntax Exceptions Remarks Example BrowserCompatibility SeeAlso
In This Topic
setCapability(Vintasoft.Twain.WebTwainDeviceCapabilityIdEnumJS,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: WebTwainDeviceCapabilityIdEnumJS
var twainCapabilityValue; // Type: string

value = instance.setCapability(twainCapabilityId, twainCapabilityValue);

Parameters

twainCapabilityId
An identifier of TWAIN device capability as an instance of WebTwainDeviceCapabilityIdEnumJS 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.WebTwainDeviceCapabilityIdEnumJS("ISupportedSizes"), pageSizeValue);
    }
    catch (ex) {
        alert(ex);
    }
}

Browser Compatibility
9
See Also