3

I have 64 bit Windows and 64 bit Python . In the twain docs said : supports only 32 bit . I have used twain data source to install my 64 bit machine and used this code to connect scanner device:

import twain
sm = twain.SourceManager(0)
ss = sm.OpenSource()
ss.RequestAcquire(0,0) 
rv = ss.XferImageNatively()
if rv:
   (handle, count) = rv
twain.DIBToBMFile(handle, 'image.bmp')

When I run the app. a windows opens like : enter image description here

so why this window is empty . The scanner device will show in this window ?

Cahit Yıldırım
  • 499
  • 1
  • 10
  • 26
  • Your issue seems unrelated to 32-64 mismatch, but rather your app being unable to recognize scanner or something (I'm not familiar with Twain). However, as a general tip, when you can't find an official 64-bit build, there's usually one available [here](http://www.lfd.uci.edu/~gohlke/pythonlibs/#twainmodule) – yuvi Jan 18 '16 at 13:04
  • Please take the answer seriously. as we all stuck and looking for solution at-least with python27 and twain. i have all the hardwares which supports TWAIN, ISIS, SANE protocol. @Cahit , yuvi please share in verbose. –  Apr 04 '16 at 06:05
  • 2
    @YumYumYum I have solved the problem installed the 32 bit version Python and used to it. 64 bit Python does not work to use twain module in my 64 bit computer. – Cahit Yıldırım Apr 04 '16 at 13:42

1 Answers1

1

The driver files for a 32 bit driver will be placed twain_32 folder and 64 bit driver files under the twain_64 folder. The twain DSM which searches for the drivers available has two versions 32 and 64 bit. The 32 bit version of the DSM looks for the drivers in the twain_32 folder and 64 bit version under the 64 bit version of the folder. Hence, it looks like you need to check which version of the driver is installed (32/64 bit). Dependency walker will help you quickly resolve this issue. More details on dependencies - Refer to chapter 12 - https://www.twain.org/wp-content/uploads/2016/03/TWAIN-2.2-Spec.pdf