TWAIN Acquisition Issues

Feature Requests for GdPicture.NET.
User avatar
Site Admin
Posts: 5743
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

TWAIN Acquisition Issues

Post by Loïc » Tue Apr 28, 2009 10:38 am


If you encounter a TWAIN acquisition problem with a device (scanner, digital camera or capture card), please follow these steps in order to get support.

1- Check you are using the latest version of the Toolkit you are using. See:
2- Check you are using the latest TWAIN Data Source manager*. You can download it from
3- Check your are using the latest TWAIN driver's version of your device.
4- If your device can be controlled by both WIA bridge from Microsoft & the TWAIN driver of the supplier, you have to use the TWAIN driver (else you will have problems to control the document feeder).
5- Check our asynchronous TWAIN demo application developed with good practices: viewtopic.php?t=2861
6- Check your application is targeted to x86 processor. If you are using x64 or AnyCPU on 64-bit OS you will need a 64-bit TWAIN driver.

*Please ensure that the TWAIN.DLL version is higher or equal to 2.3.0. We've experienced critical issues with the 2.1 and some drivers of entry level devices.

If your problem persists, please follow these steps (90% of our reported TWAIN issues are solved by following this procedure):

1- Create a new support case in
2- Give us the name and version of the GdPicture Toolkit you are using.
3- Give us the exact device reference IE: CANON DR 9080C, and the TWAIN driver (including version) you are using IE: DR-9080C ISIS/TWAIN driver version 1.3 for Windows 98, Me, NT 4.0, 2000 and XP.
4- Give us your operating system version. IE: Windows Vista Ultimate 32bit.
5- Provide a code snippet reproducing the undesired behavior (1). We need to be able to run the code with a simple copy/paste. Or simply use the "asynchronous TWAIN demo application", in such case you need to mention which options of the application has been activated.
6- Provide a log file generated by your code snippet. To generate a log file just add the TwainStartLog("c:\logs\twainlog.txt") at the beginning of your code , see sample below. Please ensure yourself to run your code only 1 time for the log generation. Otherwise investigations will be impossible for us.
7- Provide us with the log generated by the TWAIN Data Source Manager. Here you is how to generate it:
  • Go to Control panel > System and security > Advanced system settings and click the "Environment Variables..." button.
  • In the Environment Variables window, click the "New" user variable button and create it as follow:
    • Variable name: TWAINDSM_LOG
    • Variable value: absolute path to where you want the log to be generated, D:\twain.log for instance.
  • Click OK > OK > OK
  • Finally, run the TWAIN application just like you did for the previous log file and you will find the twain.log at the given location.
(1) Example of code snippet reproducing a problem:

Code: Select all

Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command3.Click
        Using oGdPictureImaging As New GdPicture.GdPictureImaging
           oGdPictureImaging.TwainLogStart("c:\twainlog.txt") 'Log generation at the beginning !! 
           Dim ImageID As Integer = oGdPictureImaging.TwainAcquireToGdPictureImage(Me.Handle)
           oGdPictureImaging.SaveAsJPEG(ImageID, "test.jpg")
           'TwainUnloadSourceManager() call is highly suggested if there is subsequent scanning processes using different windows handles.
           oGdPictureImaging.TwainUnloadSourceManager(Me.Handle) or started from different thread(s).
       End Using
End Sub

Note 1:
TWAIN issues investigation is a big challenge and time consuming. Therefore, we will investigate a new TWAIN issue only if all steps described above have been followed.

Note 2:
If you encounter problem under CITRIX, please have a look on the following knowledge bases:

- TWAIN Redirection Support with Presentation Server 4.0:
- Troubleshooting TWAIN with Citrix Presentation Server 4.0:

Thank you in advance for your comprehension.

The GdPicture Support Team


Who is online

Users browsing this forum: No registered users and 2 guests