Loads and sets the specified scanner.
The JavaScript code below demonstrates how to set a scanner, where scannerSelect is an HTML select element that contains the scanners that were previously retrieved (and stored in the scanners variable) using the getScanners method:
function onScannerLoaded(status) {
if (status.get_status() !== ImageGear.Web.Isis.ImGearIsisStatus.Completed) {
alert(status.get_statusMessage());
}
// The scanner can now be accessed through the ImGearIsisScannerSession scanner property.
var scanner = scannerSession.get_scanner();
// You could use the getTag method or getAllTags method here
// to get the current scanner settings.
}
var select = document.getElementById('scannerSelect');
var selectedScanner = scanners.getScanner(select.selectedIndex);
// Set the scanner that is selected in the connected list.
scannerSession.setScanner(selectedScanner, onScannerLoaded);