[WJG] (10/Sep/06) A quick search for Tcl/Tk resources to access TWAIN devices doesn't reveal much. There's Xbit but this is not opensource. A quick Google Search provides details of only a small handful of development resources which are quite pricy for simple one-off projects. One these firms is '''DOSDADI''', the creators of an excellent commercial package called '''EZTwain Pro''' which does everything ''but'' they have also released the first version, '''EZTwain Classic''', into the public domain. Problem solved! EZTWAIN classic is a Windos DLL which adds a higher level of abstraction over TWAIN_32.dll shipped with Windows. Getting access to these functions was unbelievably easy using ffidl.dll and a quick look at the function declarations given in EZTWAIN.H. Further examples and details are given in the documentation for the full-product availabel at http://www.dosadi.com/EZTwain_User_Guide.pdf though some simple, yet consistent function renaming has taken place. The code sample below shows how, in three lines, a TCL script can automate the scannig process. As EZTWAIN is a freebie it is limited to BMP file support only. However, this has not been to much of a hassle as I, like others that would find this useful, have probably already installed GraphicsMagick for conversions etc. I do have a fuller version that covers all the remaining functions of the EZTWAIN.DLL which I can send to anyone that asks. Happy scanning! #--------------- # Tcl_EZTWAIN.tcl #--------------- # Convert required functions in EZTW32.dll into Tcl proceedures using Ffidl # # EZTW32.DLL http://www.dosadi.com/eztwain1.htm # ffidl.dll http://rutherglen.ics.mq.edu.au/~steffen/tcltk/ffidl/doc/ load ffidl05.dll #--------------- # Basic Calls #--------------- ffidl::callout EZ_TWAIN_AcquireToFilename {long pointer-utf8 } int [ffidl::symbol EZTW32.dll TWAIN_AcquireToFilename] #--------------- # select source and pre-scan and acquire to file #--------------- proc demo {} { EZ_TWAIN_AcquireToFilename 0 Demo.bmp exit } demo