Search

Atalasoft Knowledge Base

HOWTO: Remove WIA Devices from WingScan Scanner List

Administrator
WingScan

Since WingScan is designed to be run on end-users machines you often will not have control over what scanners they are using. This quick How-to shows how to suppress WIA devices in the WingScan scanners list. This is useful as most scanners that show as having a WIA entry also have a native TWAIN entry. There's also the possibility that the WIA entry does not work as expected, as it is a wrapper around the device and may introduce other issues.

WingScan was developed to use standards based web technologies as much as possible, so it is relatively simple to go ahead and remove those scanners from the scanning list after initializing WingScan.

The javascript code you can use for this is:

setTimeout(function () { $('.atala-scanner-list option[value^=WIA-]').detach(); }, 300);

What this does is it finds all the options in the scanner list that start with WIA- and removes them. It waits 0.3 seconds to make sure the list is completely populated.

Just call that any time after you have initialized WingScan. A full example in the context of an application is:

//Example only, just put the setTimeout after your WebScanning.initialize call.
function InitializeWebScanning() {
	Atalasoft.Controls.Capture.WebScanning.initialize({
		/* 
		All your scanning init properties here.
		*/
	});

	//This removes all options starting with WIA- from the list with 
	//class 'atala-scanner-list'. Which is the name we're expecting.
	setTimeout(function () { $('.atala-scanner-list option[value^=WIA-]').detach(); }, 300);
}

Original Article:

Q10371 - HOWTO: Removing WIA devices from WingScan scanner list

Details
Last Modified: 6 Years Ago
Last Modified By: Administrator
Type: HOWTO
Article not rated yet.
Article has been viewed 1.1K times.
Options
Also In This Category