Forum Replies Created
I installed Lexmark_Network_TWAIN_Scan, but this made no difference
That’s because you aren’t using TWAIN at all. Windows Fax And Scan does not use TWAIN to communicate with the scanner, it uses WIA (Microsoft’s proprietary alternative to TWAIN.)
On my system I have 5 TWAIN drivers, but Windows Fax And Scan only sees the scanner that has a WIA driver.
Similarly, VueScan does not use TWAIN to control your scanner, it includes its own drivers for all the scanners it supports.
As it says on the website: “It replaces the software that came with your scanner”.
VueScan itself can function as a TWAIN driver to applications, but only if it can already communicate directly, on its own, with your scanner.
I guess it’s possible, but I would be surprised if VueScan supports any scanner over a network connection – VueScan seems to like USB, Firewire & SCSI.
So I’m not sure we’ve established that TWAIN is working with any scanner on your PC, including that HP multifunction, or that you need TWAIN to work on your system, since you haven’t mentioned any applications that scan using TWAIN.
If you are happy scanning with Fax And Scan, which uses WIA, it seems pretty clear to me that the Lexmark network WIA driver isn’t working. Your Lexmark is listed as a WIA device, you can initiate a scan (I assume the printer wakes up and makes scanning noises) – so we know the WIA driver is communicating with the printer.
Unless Lexmark is claiming that Fax And Scan has a bug, all the symptoms point to a bug or configuration problem with the Lexmark WIA driver, or the Lexmark printer.
Yes, it’s possible that Fax and Scan has a bug – but then why does the HP multifunction work? (I’m assuming you tried it with Fax And Scan.)
Yikes, let me see if I can find the code for that! I’ll probably have to just open-source it on GitHub or something, I am going to have minimal time to work on it in future.
Regarding what dpenney said:
I know, he doesn’t need my support, I just don’t get to post a ‘me too’ post very often.
Barcode detection definitely does not depend on TWAIN except in rare cases.
The catch with barcode detection is that some TWAIN scanners (or their drivers) can do it, but most can’t.
So – if you know that all your scanners can do this, then you can have the scanner do the work. However, figuring out how to do that is quite complicated, you’ll need to study and understand the Extended Image Information feature of TWAIN, for example.
If you are writing an application that needs to work with scanners that don’t do barcode recognition (i.e. most scanners) then it has to be done in software, as part of your application. Many imaging toolkits can do barcode recognition.
You can also license a barcode-recognition library, there are a lot of them (Inlite, OnBarcode, many others). And there are some free barcode recognition libraries, such as Zebra Crossing (https://github.com/zxing/zxing)
It’s more common for TWAIN scanners to support automatic blank-page discarding, but certainly not universal – definitely not flatbeds, and I wouldn’t count on most multi-function devices doing it either. Almost any imaging library should be able to do blank-page detection although you may have to do some digging to figure out how to code it.
Hi Jason – there is lots of information (admittedly you sometimes have to dig) about membership in the TWAIN Working Group, on the http://twain.org website – look for ‘Membership’ links.
However, you don’t need any license or permission to write an application that uses the TWAIN API.
The library you need to talk to is the TWAIN Data Source Manager (DSM), which is a dynamically-loaded library, available from SourceForge:
The TWAIN specification describes the entry points of that library (DLL, on Windows) but – using C as the reference language.
So to call the DSM, you need to understand both the DSM entry points and JNA quite well.
I recommend searching for example JNA code that talks to TWAIN, because it will save you a lot of work.
This article, for example, looks quite thorough:
Hey Martin – very interesting!
I am not writing so much TWAIN code these days, but I look forward to taking a close look at your framework, especially for the DS side.
Hmm, well, first I guess I have to upgrade to VS2015?
Hi TwainMan123 – it is very unlikely that the UI of a TWAIN scanner does not work.
So most likely the problem is in the code in your application, that is controlling the scanner through the TWAIN API.
What is the code that you are using to talk to the scanner? Is it an open-source project, or a commercial library, or you wrote it from scratch?
And it’s OK to say the name and model of your scanner 8)
Hmm. A TWAIN driver is a complicated animal. Maybe the guy who wrote videods.ds would sell or give you the source code.
Wait, that’s me. 8)
In fact looking at my own notes, that problem with the temp file was fixed, supposedly, in VideoDS version 1.06 back in 2009.
So I’m attaching a 1.06 copy of VideoDS.ds for you to try, and a .zip of the latest source code in case you want to try rebuilding or customizing it.
Obviously all the usual disclaimers apply – this code comes with no warranty express or implied, you are entirely responsible for anything you do with it and any consequences thereof.August 14, 2015 at 4:53 pm in reply to: How to list the Twain data sources only (excluding WIA)? #26309
Hi Shaheer – I don’t believe there is any way to restrict the set of TWAIN data sources listed in the Select Source dialog.
What people normally do is present their own list using their own UI, and then they can filter the list however they like.
This doesn’t allow the user to set the global ‘default TWAIN scanner’ however, although probably even that can be done if you are willing to do a ‘hack’. 8)
Yes… sort of. Here are the main problems:
1. There are no TWAIN properties that are guaranteed to appear only on cameras or only on scanners.
(This question has come up before. Google is your friend.)
2. To get the properties of a device, you have to open the device.
3. When you open a device that is not powered on and connected, the TWAIN driver will display a message to the user.
(No, you can’t prevent this.)
4. Some TWAIN drivers (I’m lookin’ at you, Kofax…) can take up to 10 seconds to open, and almost another 10 seconds to close.
What this means is that going through the list of TWAIN devices, and checking the properties of each one, could cause some real problems.
You could reduce these problems by having your program remember whether a device was a scanner or camera, so it would only check the first time a device appeared in the list.
The list of cameras in the TWAIN list isn’t the same as the list of DirectShow devices!
Why not use DirectShow to get the list of (DirectShow) sources, and use the TWAIN list as the list of TWAIN devices?
How could I separate web cameras from scanners in two different list?
I found only this article that much my question
http://forums.codeguru.com/showthread.p … evice-list
but unfortunately it didn’t answer for my question.
I looked at that thread on codeguru.com, it seems to answer your question exactly.
It says “You can’t do that,” and he’s right.
What’s the larger problem that this is part of?
Hi piaking – “Using Framework 2.0” is not very clear, we don’t all work in .NET.
If you mean .NET Framework 2.0, then, OK – but I’m sure you are using something else for your TWAIN calls, because there is no TWAIN support in .NET Framework, in any version.
So what is that _twain object?
To select A4, you probably want to set the paper size.
I see you have tried using this, inside a bunch of other code:
That is the correct approach. Get rid of all the code around it, the IsCapSupported(TwCap.SupportedSizes); and so on.
I’m sure your CanoScan supports ICAP_SUPPORTEDSIZES, you don’t need to check that.
And you don’t need to check to see if A4 is supported, or whether it can be set – A4 is supported, and it can be set.
Just set it and see what the error return code is.
About clearing the preview image: There is no way to do this with standard TWAIN. TWAIN does not define any such command or operation. Why do you want to do that?
Hey TOR – glad you were able to solve it, sorry the rest of us were no help.
And thanks *very* much for sharing the solution you found.
The other thing that can cause this is a conflict between your DS and the app (VixWin).
The most common conflict I’ve seen is that there is a DLL used by both, but they don’t agree on the version – A DS for example expects to load xyz.dll (version 1.5) and the Application also loads xyz.dll – but expects version 3.2.
Have you debugged your .DS inside VixWin, and watched the Output window when your .ds loads, to see if there are any DLLs that load from unexpected places, or don’t load when they usually would – because VixWin already loaded them?
For that matter, what happens when VixWin does enumeration – does your .ds even load?
If it does, then it must be reporting failure at some point. Step into it and find out why.
If it doesn’t even load, then that is most likely a problem with a DLL that is statically-linked to your DS, and for some reason it can’t be found when VixWin loads your .ds. Are you familiar with Dependency-walker?