How to identify WIA scanner

Discussions about TWAIN & WIA scanning in GdPicture.NET using GdPictureImaging.
Post Reply
rgoodson40
Posts: 32
Joined: Sun Jan 30, 2011 8:40 pm

How to identify WIA scanner

Post by rgoodson40 » Fri Apr 06, 2012 6:34 am

Hello,

When I call the method TwainSelectSource, all of the scanner driver's appear, including WIA drivers. If my user chooses a WIA driver, I want to be able to scan using the WIA methods. I am able to identify that the user chose a WIA driver because it usually has WIA in the source name or in the source family.

In order to scan using WIA methods I need to open the scanner using the scanner's SourceID. The problem is that there is no good way of getting the source id of the scanner that was chosen within the TWAINSelectSource dialog. I can loop through the available WIA scanners using the WIAGetSourceName method, but the WIA source Name's don't match the names that were previously given when calling the TWAINGetSourceName method, so there is no good way to match the scanner that they chose to the appropriate WIA SourceID.

I know that you are going to say not to use WIA scanning, but unfortunately they show up in the TWAINSelectSource dialog, so user's will naturally choose them. Plus, I need my user's to be able to use the WIA driver in the event that the TWAIN driver doesn't work, as is the case with my Xerox Documate 510 scanner, which will not open when scanning in a separate thread.

What would be the best way to correctly match a WIA scanner chosen from the TWAINSelectSource dialog to the appropriate WIASourceID?

Thanks,
Reagan

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: How to identify WIA scanner

Post by Loïc » Sun Apr 08, 2012 1:05 pm

Hi,
I know that you are going to say not to use WIA scanning,
Absolutely. And I repeat myself: Don't use TWAIN to WIA bridge driver in TWAIN scanning sessions. Or at least, do not expect to get things working with this approach, especially with scanner having document feeder.
If you want to use WIA driver, use WIA scanning session through the "WIA" prefixed methods.

IE:

http://office.microsoft.com/en-us/help/ ... 98310.aspx
WIA drivers may not work for scanners that have automatic document feeders. If your scanner has an automatic document feeder, you should install and use the TWAIN driver for best results.
but unfortunately they show up in the TWAINSelectSource dialog, so user's will naturally choose them
The solution is very simple: Implement your own TWAIN driver selection dialog box and do not expose driver name starting by "WIA".

Let me know if you need special precision on this point.

Kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests