getSupportedSaneScanModes Method
In This Topic
Returns supported scan modes of opened SANE device.
Syntax
var instance = new Vintasoft.Twain.WebTwainDeviceJS(deviceName, productFamily, manufacturer, driverVersion, twainVersion, deviceManager, is64Bit);
var value; // Type: string[]
value = instance.getSupportedSaneScanModes();
function getSupportedSaneScanModes() : string[];
Return Value
A string array that contains names of supported scan modes of SANE device.
Exceptions
Exception | Description |
| Thrown if device is not opened OR error occurs during getting value of device capability. |
Example
// Gets information about supported scan modes of opened SANE device.
function getSupportedSaneScanModes(saneDevice) {
try {
console.log("SANE device: " + saneDevice.get_DeviceName());
// if SANE device is not opened
if (!saneDevice.get_IsOpened()) {
console.log("Device is not opened. Please open device.");
return;
}
// get information about supported scan modes of SANE device
var saneScanModes = saneDevice.getSupportedSaneScanModes();
console.log("Supported scan modes:");
// for each supported scan mode
for (var i = 0; i < saneScanModes.length; i++) {
// output information about scan source
console.log("- " + saneScanModes[i]);
}
}
catch (ex) {
alert(ex);
}
}
Browser Compatibility
See Also