Kodak Document Scanners

TWAIN Driver Frequently Asked Questions (FAQ)

03-July-2012

 

Contents

 

1.0 Installation

1.1 Driver Files

1.2 Installing Previous Versions

1.3 Uninstalling the Driver

1.4 Removing KDSMM

 

2.0 Troubleshooting

2.1 Application Cannot Find Source

2.2 Real-Time Display Problem

2.3 Application Hangs When Trying To Scan

2.4 TWAIN Opens Very Slowly

2.5 System cannot find KDS.DLL

2.6 1394/SBP2 Issues

2.7 Platen Autocrop/Deskew

2.8 The SETUP001.INI File

2.9 ICAP_UNITS Causing Problem

2.10 CAP_PRINTERINDEX Persistence

 

 

3.0 Development

3.1 Scanner Simulator

3.2 KDS_HOMEDIR

3.3 DEBUG / DEBUGFILTER

3.4 ICAP_XFERMECH

3.5 KDSTST.EXE

3.6 Custom Capabilities

3.7 Force Compression

3.8 Force Version (3590 only, 1.x firmware)

3.9 Force Resolution (3590 only, 1.x firmware)

3.10 ICAP_PIXELTYPE (3590/4500/i200/i600/i700/i820/i840/i900/i1100/i1200/i1300/i1400/i1800/i2000/i2900/i3000/i4000/i5000)

3.11 Width and Length Alignment

3.12 Polarity

3.13 Feeder Keep Alive (3000/4000 Series)

3.14 Length Detection and Frames (3000/4000 Series)

3.15 MSG_STOPFEEDER Operation

3.16 JPEG Quantization (3590/4500/i820/i840/i200/i600/i700/i900/i1100/i1200/i1300/i1400/i1800/i2000/i2900/i3000/i4000/i5000)

3.17 Multiple Modes (5xxx/7xxx/9xxx series)

3.18 DAT_EXTIMAGEINFO

3.19 ICAP_FRAMES

3.20 Color Dropout: Enhanced Processing

3.21 i30/i40 Button Mapping

3.22 Displaying Scanner Operator/Info Log

 

 

4.0 Known Issues

4.1 Programmatic Constraints

4.1.1 ICAP_COMPRESSION

4.2 Delay with MSG_ENDXFER

4.3 Fix for Overscan (3xxx Series)

4.4 DEFAULTS button does not affect the following...

4.5 TIFF JPEG (3590/4500/i820/i840/i600/i700/i200/i900/i1100/i1200/i1300/i1800/i2000/i2900/i3000/i4000/i5000)

4.6 Scanner Does Not Always Report Jams (5xxx/7xxx/9xxx)

 

5.0 Acknowledgements

5.1 Intel(r) JPEG Library

5.2 Picture Elements(tm) ChromaTHR(tm), 3590/4500, 4.x only

 

 

1.0 Installation

The TWAIN drivers are intended for production use with the following Kodak Digital Document Scanner model numbers:

 

    Model                          Supported Driver Versions

    i30, i40                                  6.x 

    i250, i260                     4.x

    i620, i640, i660                     5.x  6.x

    i700                                                        9.x

    i810, i820, i830, i840         4.x        6.x

    i1100                                                       9.x

    i1200, i1300                                    7.x

    i1400                                                       9.x

    i1800                                                 8.x

    i2900, i3000                                                                    12.x

    i4000                                                             10.x

    i5000, i2000, i900                                                       11.x

    PS50, PS80                                                                      12.x

    

 

If you are developing an Application and do not have access to a scanner refer to section 3.1 to learn how to use the Scanner Simulator.  Please note that not all drivers support all scanners.  Check the ramscan.txt file for the list of supported scanners for your driver.

 

 

1.1 Driver Files

The installation places its main files into a directory of the form "kds_model", for example: kds_i600.

 

Because of this mechanism multiple KDS TWAIN drivers can co-exist on a system.  The installation will always make itself the new default (per the TWAIN spec), but it is up to the user to change the selection to the most appropriate driver for whatever scanner is in use.

 

For ease of reading the rest of this document will refer to the 'kds' directory in commentary and examples, even for installs that may be of the form "kds_i600".

 

A 4.x installation includes the following files, which are placed in the %win%\twain_32\kodak\kds directory:

 

    a shortcut to const.ini            ; shortcut to driver configuration settings

    a shortcut to kds.log              ; shortcut to driver log

    a shortcut to ramscan.txt          ; shortcut to simulator settings

    a shortcut to setup001.ini         ; shortcut to GUI snapshot of last session

    const.ini                          ; link to real const.ini

    hippo.dll                          ; image processing library

    kds.ds                             ; the driver

    kdscust.h                          ; custom TWAIN capabilities

    kdstst.exe                         ; KODAK diagnostic tool

    l_ch_chn.ini                       ; Simplified Chinese

    l_ch_twn.ini                       ; Traditional Chinese

    l_de_deu.ini                       ; German

    l_en_usa.cnt                       ; English table of contents

    l_en_usa.hlp                       ; English help file

    l_en_usa.ini                       ; English

    l_es_esp.ini                       ; Spanish

    l_fr_fra.ini                       ; French

    l_it_ita.ini                       ; Italian

    l_nl_nld.ini                       ; Dutch

    l_pt_bra.ini                       ; Portuguese-Brazilian

    memgrp.dll                         ; Group-4 support

    readme.txt                         ; the old readme file

 

A 5.x installation consists of the following files, which are placed in the %win%\twain_32\kodak\kds directory:

 

    a shortcut to const.ini            ; shortcut to driver configuration settings

    a shortcut to kds.log              ; shortcut to driver log

    a shortcut to ramscan.txt          ; shortcut to simulator settings

    a shortcut to setup001.ini         ; shortcut to GUI snapshot of last session

    hippo.dll                          ; image processing library

    kds.ds                             ; the driver

    kdscust.h                          ; custom TWAIN capabilities

    kdstst.exe                         ; KODAK diagnostic tool

    l_en_usa.hlp                       ; English help file

    memgrp.dll                         ; Group-4 support

    readme.txt                         ; the old readme file

 

 A 6.x installation consists of the following files, which are placed in the %win%\twain_32\kodak\kds_ixxxx directory:

 

    a shortcut to const.ini            ; shortcut to driver configuration settings

    a shortcut to kds.log              ; shortcut to driver log

    a shortcut to ramscan.txt          ; shortcut to simulator settings

    a shortcut to setup001.ini         ; shortcut to GUI snapshot of last session

    hippo.dll                          ; image processing library

    kds.ds                             ; the driver

    kdscust.h                          ; custom TWAIN capabilities

    kdstst.exe                         ; KODAK diagnostic tool

    l_en_usa.hlp                       ; English help file

    readme.txt                         ; the old readme file

 

A 7.x installation consists of the following files, which are placed in the %win%\twain_32\kodak\kds_ixxxx directory:

 

       help                               ; help directory

        ch_chn.chm                     ; Simplified Chinese help file

        ch_twn.chm                     ; Traditional Chinese help file

        de_deu.chm                     ; German help file

        en_usa.chm                     ; English help file

        en_usa.chm                     ; English help file

        es_esp.chm                     ; Spanish help file

        fr_fra.chm                     ; French help file

        it_ita.chm                     ; Italian help file

        nl_nld.chm                     ; Dutch help file

        pt_bra.chm                     ; Portuguese-Brazilian  help file

    lib                                  ; lib directory

        i1200_i1300.ekpgct             ; colortable package

        hippo.dll                      ; image processing library

        firmware.dll                   ; firmware library

        ecdo                           ; ecdo directory

            GreenDefault.ekpgcd        ; default green color dropout

            BlueDefault.ekpgcd         ; default blue color dropout

            RedDefault.ekpgcd          ; default red color dropout

    a shortcut to kds_ixxx             ; shortcut to driver log directory

    const.ini                          ; driver configuration settings

    kds.ds                             ; the driver

    kdscust.h                          ; custom TWAIN capabilities

    kdstst.exe                         ; KODAK diagnostic tool

    twaingui.exe                       ; the driver gui

 

A 8/9.x installation consists of the following files, which are placed in the %win%\twain_32\kodak\kds_ixxxx directory:

 

       help                               ; help directory

        ch_chn.chm                     ; Simplified Chinese help file

        ch_twn.chm                     ; Traditional Chinese help file

        cs_cze.chm                     ; Czech help file

        de_deu.chm                     ; German help file

        en_usa.chm                     ; English help file

        es_esp.chm                     ; Spanish help file

        fr_fra.chm                     ; French help file

        it_ita.chm                     ; Italian help file

        jp_jpn.chm                     ; Japanese help file

        ko_kor.chm                     ; Korean help file

        nl_nld.chm                     ; Dutch help file

        pt_bra.chm                     ; Portuguese-Brazilian  help file

        ru_rus.chm                     ; Russian help file

        tr_tur.chm                     ; Turkish help file

    install                            ; installation directory

        install.log                    ; Installations log file

        UNWISE.EXE                     ; Uninstall executable

    profiles                           ; Predefined profiles directory

        <model>                        ; model directory          

    a shortcut to kds_ixxx             ; shortcut to driver log directory

    kds.ds                             ; the driver

    kdstst.exe                         ; KODAK diagnostic tool

    twaingui.exe                       ; the driver gui

 

and all the lib files is installed in the %win%\system32\kodak\kds_ixxxx directory

 

       wiamini.dll                                         ; WIA mini-driver (interface layer)

    wiascnrwia.dll                                    ; WIA mini-driver (scanner layer)

    lib                                ; lib directory

        i1400.ekpgct                   ; colortable package

        hippo.dll                      ; image processing library

        firmware.dll                   ; firmware library

        ecdo                           ; ecdo directory

            GreenDefault.ekpgcd        ; default green color dropout

            BlueDefault.ekpgcd         ; default blue color dropout

            RedDefault.ekpgcd          ; default red color dropout

 

A 10.x installation consists of the following files, which are placed in the %win%\twain_32\kodak\kds_ixxxx directory:

 

       install

        install.log                    ; Installations log file

        installopenmp.log              ; Openmp log file      

    a shortcut to kds_ixxx             ; shortcut to driver log directory

    kds.ds                             ; the driver

    kdstst.exe                         ; KODAK diagnostic tool

 

and all the lib files is installed in the %win%\system32\kodak\kds_ixxxx directory

 

       wiamini.dll                                         ; WIA mini-driver

    lib                                ; lib directory

        device.dll                     ; device library

        devicemanager.dll              ; device manager library

        driver.dll                     ; driver library

        hippo.dll                      ; image processing library

        ixxx.ekpgct                    ; colortable package

        osjit.dll                      ; Os just in time

        twaingui.exe                   ; driver gui

        ecdo                           ; ecdo directory

            BlueDefault.ekpgcd         ; default blue color dropout

            GreenDefault.ekpgcd        ; default green color dropout

            RedDefault.ekpgcd          ; default red color dropout

             help                            ; help directory

            ch_chn.chm                  ; Simplified Chinese help file

            ch_twn.chm                  ; Traditional Chinese help file

            cs_cze.chm                  ; Czech help file

            de_deu.chm                  ; German help file

            en_usa.chm                  ; English help file

            es_esp.chm                  ; Spanish help file

            fr_fra.chm                  ; French help file

            it_ita.chm                  ; Italian help file

            jp_jpn.chm                  ; Japanese help file

            ko_kor.chm                  ; Korean help file

            nl_nld.chm                  ; Dutch help file

            pt_bra.chm                  ; Portuguese-Brazilian  help file

            ru_rus.chm                  ; Russian help file

            tr_tur.chm                  ; Turkish help file

        profiles                        ; Predefined profiles directory

            20060526175022901.profile   ; Black and White Document

            20060526175022902.profile   ; Black and White Document (OCR Quality)

            20060526175022903.profile   ; Color Document

            20060526175022904.profile   ; Color Document (OCR Quality)

            20060526175022905.profile   ; Color Photograph

            bitonaldocument.png         ; Black and white document graphic file

            bitonaldocumentocr.png      ; Black and white document OCR graphic file

            colordocument.png           ; Color document graphic file

            colordocumentocr.png        ; Color document OCR graphic file

            colorphoto.png              ; Color photograph graphic file

            default.png                 ; Default graphic file

        sounds                          ; Multifeed sounds

            ding.wav                    ; Ding sound

 

A 12.x installation consists of the following files, which are placed in the %win%\twain_32\kodak\kds_ixxxx directory:

 

       install

        install.log                    ; Installations log file

        installopenmp.log              ; Openmp log file      

    a shortcut to kds_ixxx             ; shortcut to driver log directory

    kds.ds                             ; the driver

 

and all the lib files is installed in the %win%\system32\kodak\kds_ixxxx directory

 

       wia.dll                                                ; WIA driver file

       wiaentry.dll                                       ; WIA driver file

    lib                                ; lib directory

        device.dll                     ; device library

        devicemanager.dll              ; device manager library

        driver.dll                     ; driver library

        hippo.dll                      ; image processing library

        ixxx.ekpgct                    ; colortable package

        lexexe.exe                     ; image processing library file

        osjit.dll                      ; Os just in time

        setup.txt                      ; versions file

        twaingui.exe                   ; driver gui

        twaingui.exe.config            ; driver gui file

        vcomp100.dll                   ; image processing library file

        ecdo                           ; ecdo directory

            BlueDefault.ekpgcd         ; default blue color dropout

            GreenDefault.ekpgcd        ; default green color dropout

            RedDefault.ekpgcd          ; default red color dropout

            McdoKodakMultiColor.ekpgcd ; multi-color dropout

            McdoKodakSingleColor.ekpgcd; single-color dropout

             help                            ; help directory

            ch_chn.chm                  ; Simplified Chinese help file

            ch_twn.chm                  ; Traditional Chinese help file

            cs_cze.chm                  ; Czech help file

            de_deu.chm                  ; German help file

            en_usa.chm                  ; English help file

            es_esp.chm                  ; Spanish help file

            fr_fra.chm                  ; French help file

            it_ita.chm                  ; Italian help file

            jp_jpn.chm                  ; Japanese help file

            ko_kor.chm                  ; Korean help file

            nl_nld.chm                  ; Dutch help file

            pt_bra.chm                  ; Portuguese-Brazilian  help file

            ru_rus.chm                  ; Russian help file

            tr_tur.chm                  ; Turkish help file

        profiles                        ; Predefined profiles directory

            20060526175022901.profile   ; Black and White Perfect Page Document

            20060526175022903.profile   ; Color Perfect Page Document

            20060526175022905.profile   ; Color Photograph

            bitonaldocument.png         ; Black and White Perfect Page Document graphic file

            colordocument.png           ; Color Perfect Page Document graphic file

            colorphoto.png              ; Color photograph graphic file

            default.png                 ; Default graphic file

        sounds                          ; Multifeed sounds

            ding.wav                    ; Ding sound

 

The KDS memory manager is installed in the %win%\system32 directory.

 

    kdsmm.sys                          ; memory management

 

The following freely distributable file from Intel is placed in the %win%\system32 directory for Microsoft NT type OS's and the %win%\system directory for Microsoft Windows 9x OS's.  This library is built static into version 6.x and greater.

 

    ijl15.dll                          ; JPEG support

 

 

1.2 Installing Previous Versions

If for some reason it is necessary to install a previous version of the Source, the user must remove the current installation first.  Refer to the section on "Uninstalling the Driver."

 

 

1.3 Uninstalling the Driver

The preferred method is to go into Add/Remove Programs under the Control Panel, and remove either Host Diagnostics or SVT.  Note that if both are installed on a system then uninstalling either one will result in the removal of the TWAIN driver, making the remaining application unusable.  For 5.x drivers Add/Remove Programs will list the individual drivers installed (e.g. “Kodak i620/i640/i660 Scanner”).  Removing this from the list will only uninstall the driver and the writeable data that goes with it.  All other installed Kodak scanner drivers will remain.  With 5.x, SVT will only be uninstalled when the last Kodak Scanner driver is uninstalled.

 

If Add/Remove Programs does not exist, or there is a need to just get rid of TWAIN (perhaps as part of a version rollback) the quickest way to do this is to go to  %win%\twain_32\kodak and delete the appropriate kds directory(s).  Do not forget about the writeable data directory.  Check the shortcuts to see where it is located.

 

 

1.4 Removing KDSMM

KDSMM is used by the system to allocate the large blocks of memory needed by the scanners to perform at their maximum speeds.  If it is absolutely necessary to stop using this driver it can be turned off by deleting or renaming the KDSMM.SYS in the %win%\system32\drivers directory.

NOTE: turning this driver off will prevent the TWAIN driver from running at its maximum speed.

 

 

2.0 Troubleshooting

This section addresses problems that may come up when using the driver, and offers some possible actions that users must attempt before calling for support.

 

 

2.1 Application Cannot Find Source

There are four reasons that an Application may be unable to locate the Source.

 

1) The Source must be located in the proper directory, which is:  %win%\twain_32\kodak\kds

 

2) A needed DLL may be missing.  The Source relies on the presence of the following DLL's:  kernel.dll, user32.dll, gdi32.dll, comctl32.dll, comdlg32.dll, advapi32.dll, shlwapi.dll, shell32.dll, winspool.drv, twain_32.dll, wnaspi32.dll.

 

3) Some or all of %win%\twain_32\kodak\kds is write protected.  See section 3.2 for a possible way around this.

 

4) The Application may not be setting the appIdentity.SupportedGroups to DG_CONTROL | DG_IMAGE when looking for the available Sources.  Or the Application may not have set #pragma pack(2) in the correct places.  Consider these possibilities last, and only if you are writing your own Application.

 

 

2.2 Real-Time Display Problem

If your application does a real-time display of images on the fly, it's possible that you may see pauses in the display, even though the scanner and software are running at rated speed.

 

The Source polls for images on the scanner, and if none are found it sleeps for a specified period of time, and then tries again.  This behavior is PC friendly in that it consumes fewer clock cycles on the PC and issues fewer commands to the scanner.  However, if the application is displaying each image in real-time, it can result in a display that appears to start and stop for no apparent reason.

 

One possible solution is to adjust the PollSleep value.  Edit the CONST.INI field, and under the [dsIdentity] section add the line:

 

            PollSleep=100

 

This specifies a sleep value of 1/10th of a second.  Adjusting this value can result in a smoother real-time display.  Be careful of using low values, since they can impact the performance of the system.

 

 

2.3 Application Hangs When Trying To Scan

The TWAIN Working Group specifies that the Source Manager Files (see Section 1.2) are supposed to reside in the main Windows directory.  Some Sources and Applications, though, make the mistake of installing these files in the Windows System directory (System on Windows 9x/ME, System32 on Windows NT/2K/XP).

 

This can lead to a situation where the Source and the Application end up accessing different copies of the Source Manager, which leads to hangs or crashes.  If this situation is suspected, examine the System and System32 directories for occurrances of the files listed in Section 1.2, and remove them.

 

The installation of the Source does this automatically.

 

 

2.4 TWAIN Opens Very Slowly

We have seen instances with Windows 2000 running virus scanning software where TWAIN seems to open very slowly.  At this point we suspect some interaction between the virus checking software, Windows and the TWAIN DSM (twain_32.dll).  There is no known fix at this time, other than to turn off the virus scanning software.

 

 

2.5 System cannot find KDS.DLL

KDS.DLL was used in the 1.x version of the Source, and is no longer needed.  If you see it or any file in the KDS directory ending in a .DS extension other than KDS.DS, then a re-install is recommended.  Manually delete the %win%\twain_32\kodak\kds directory first, and after the install is complete the problem will be fixed.

 

 

2.6 1394/SBP2 Issues

During the course of development of the i200 it was discovered that many OHCI compliant 1394 adapter cards carry a critical bug that can result in a fatal communication error.

 

This bug appears during scanning, terminating a session with paper left in the transport and the red light lit.  Examination of the scanner log will reveal that a "Chipset Error" has occurred.

 

As of this writing (September 2006) the only recommended 1394 card for use is the one provided in the box with the i200/i600/i1800 scanner.  If this error occurs please confirm that the correct card is installed and in use in the PC before contacting your Kodak Representative for assistance.

 

If the PC is a Pentium-III with a VIA chipset, then the use of the 1394 card supplied with the scanner is not enough to solve the problem.  Please contact your Kodak Service Representative for more information.

 

Also note that any other information on this issue that may be provided in the box with your scanner or on the Kodak website should be considered more current than this section.

 

 

2.7 Platen Autocrop/Deskew

Performing autocrop and deskew functionality is somewhat different for the platen than it is for the transport.  Most notably, the platen is far more likely to gather dust and dirt that can impact the ability of the system to locate the real image.  Regular cleaning of the platen is important if using autocrop and deskew.

 

Also be sure to check the black background on the platen cover.  This material can be wiped off with glass cleaner.

 

It is also important to perform regular calibrations of the feeder and platen systems.  Image calibration can be accessed through the Calibrate... button on the TWAIN driver's Imaging Tab.  If your application does not give you access to this function, run the Scan Validation Tool that was installed from the CD that came with your scanner.

 

If you are having problems getting autocrop and deskew to work properly, or if the feeder (ADF) to flatbed mode is not performing as well as it should off the platen, then try editing the CONST.INI file and adjusting the following value:

 

            ForceBaffleBlackPlatenAdjustment=60

 

Larger values will remove traces of dust and light scatter that show up as false image data.  Smaller values will do better at handling images with dark backgrounds.  Valid values are 0 - 255 (though 128 is really the practical limit).  When experimenting, make sure that the lamps have warmed up for at least a minute.

 

 

2.8 The SETUP001.INI File

The TWAIN Specification requires that applications save their GUI settings, so the user gets a better experience from session to session.  Unfortunately, little guidance is given in how to integrate this feature into the rest of the driver behavior.  At the time of its creation, the following scheme was selected for this driver.

 

SETUP001.INI only records a session if the driver’s GUI is raised by the application, and then only if the user selects the OK or SCAN button (depending on the kinds of GUI brought up).  The values saved reflect some, but not all, of the values shown on the GUI.  The format of the data looks very similar to the output of the DG_CONTROL / DAT_CUSTOMDSDATA / MSG_SET call, but fewer items are saved.

 

When a new session is started the SETUP001.INI file is loaded, overriding the power-on defaults for the driver.  No attempt is made to test which application generated the SETUP001.INI file, so it is possible to use one application to create the file that is read by another.  This is deliberate.  When the driver was first created there was a 50/50 split for application writers to use the GUI versus programmatic control, and the programmatic applications generally used the standard TWAIN capabilities, never any custom capabilities.  The intention of the SETUP001.INI file was to allow an end-user to set custom capabilities from the GUI and have those values remain intact when working with their preferred application.

 

This scheme may cause problems with some programmatic applications, especially if they make assumptions about the default values.  If you suspect this is happening we recommend editing the SETUP001.INI file, deleting everything after the first set of comments.  Save the results, then make the file read-only (this can be done from Windows Explorer, just right-click the mouse on the name of the file and select Properties from the menu; the read-only flag will appear on the Properties dialog); doing this will guarantee that every invocation of the driver will come up with the power-on defaults.

 

One final note:  the SETUP001.INI is not a replacement for the DG_CONTROL / DAT_CUSTOMDSDATA / MSG_SET operation.  If you wish to write an application that sets the driver using profiles, then you must use DG_CONTROL / DAT_CUSTOMDSDATA / MSG_SET to do it.

  

 

2.9 ICAP_UNITS Causing Problem

Version 9.54 and newer (as well as version 4.x and earlier) drivers will default ICAP_UNITS to TWUN_INCHES. The ForceUnits* overrides mentioned below, will no longer be supported as they are no longer needed (i.e. skip the rest of this section).

 

Version 5.x through 9.53 drivers will set the ICAP_UNITS default based on the PC’s locale, which means that languages like French will default to TWUN_CENTIMETERS. If this causes problems, the default units can be overridden using the ForceUnitsInches=1 in the const.ini file. This will overwrite the current ICAP_UNITS to inches.

 

Certain applications do not check the units when acquiring TW_IMAGEINFO->XResolution, and therefore save the wrong resolution in the image header.  If this causes problems the units in which TWAIN reports this value can be overridden using the ForceUnitsBehavior in the const.ini file. This field has the following values:

 

ForceUnitsBehavior=0    ; negotiate TW_IMAGEINFO->XResolution in the current driver units (old/default behavior)

ForceUnitsBehavior=1    ; negotiate TW_IMAGEINFO->XResolution in ICAP_UNITS last set by the application (default TWUN_INCHES)

ForceUnitsBehavior=2    ; negotiate TW_IMAGEINFO->XResolution in ICAP_UNITS last set or read by the application (default TWUN_INCHES)

 

The application “Imaging for Windows” never sets ICAP_UNITS and always expects TW_IMAGEINFO->XResolution in TWUN_INCHES.  Therefore ForceUnitsBehavior will default to 1 for this application to force the desired result.

 

2.10 CAP_PRINTERINDEX Persistence

Printer index persists differently depending on the driver version and scanner.  Versions 5.x and 6.x of the driver will always remember printer index across scan sessions.  Version 4.x of the driver should work this way for all scanners but may not in a few instances.

 

The TWAIN driver will not remember the printer index across driver sessions.  This value is lost each time the driver is unloaded.  An exception to this rule is the i800 scanners which store the printer index internally, so when the driver is reloaded it is able to acquire the last value from the scanner.

 

3.0 Development

This section contains details on features that developers can use to help write applications using this Source.

 

 

3.1 Scanner Simulator

The Scanner Simulator is a tool that allows developers to use the TWAIN Source when no physical scanner is available.

 

The previous mechanism for running the RAM Scanner has been removed from the Source.  If you were using the RAM Scanner prior to version 1.2.15, please delete any files of the form kds_*ram.ds from your %win%\twain_32\kodak\kds directory (the installation should do this for you).

 

The new Scanner Simulator mechanism is driven from the ramscan.txt found in %win%\twain_32\kodak\kds_*.

 

For 4.x drivers the scanner selection is done at the top of the ramscan.txt.  For 5.x drivers the scanner selection is done in the const.ini file.  To enter into simulation mode edit the appropriate file and change the 'Simulate' line to the desired model number (ex: i640).

 

To turn off simulation mode, set the 'Simulate' value back to zero.

 

Images generated by the Scanner Simulator reflect the current settings for ICAP_COMPRESSION (Uncompressed, Group-4 and JPEG only);       ICAP_PIXELFLAVOR and ICAP_FRAMES.

 

It is also possible to display images from files on disk.  The method for doing this is documented in ramscan.txt.

 

The sequence of events in a simulated session are controlled using the @-commands at the bottom of the file.  These commands are fully documented in ramscan.txt.

 

 

3.2 KDS_HOMEDIR

This section should no longer be needed, since the TWAIN writeable data files are now installed outside of the Windows directory.  However, KDS_HOMEDIR is still recognized by the system, so this section is left intact for those users who may have an existing dependency on it.

 

Environments where the user is prevented from writing into the %win% directory (such as secure configurations of NT/2K/XP), require that the following files be moved from the %win%\twain_32\kodak\kds directory, to some other writeable directory:

 

    const.ini

    l_ch_chn.ini

    l_ch_twn.ini

    l_de_deu.ini

    l_en_usa.cnt

    l_en_usa.hlp

    l_en_usa.ini

    l_es_esp.ini

    l_fr_fra.ini

    l_it_ita.ini

    l_nl_nld.ini

    l_pt_bra.ini

    ramscan.txt

    setup001.ini

 

It is then necessary to create an environment variable KDS_HOMEDIR, which contains the full path to the new location of these files.

 

The logfile (kds.log), if created, will appear in this alternate directory.

 

 

3.3 DEBUG / DEBUGFILTER

Users must not modify any of the Source's data files without consulting with Eastman Kodak Company.  However, there may be times during development when it is advantageous to get a snapshot of the operation of the Source.  To do this, edit the const.ini file and look for the Debug variable and set the value to two (2) or one (1) depending on whether you are trying to catch an intermittent log message, or generate an exhaustive dump of the operation of the Source.

 

Filtering the log file (kds.log) for occurrances of the string 'kdsdat' will help to isolate those messages that relate to TWAIN communication between the Application and the Source.

 

If sending a log to Eastman Kodak Company the most useful selection is typically the following for a 4.x or earlier version of the driver:

 

            Debug=1

            DebugFilter=kdsdat kdshal kdsprot

 

For 5.x and later, please use the following:

 

            Debug=1

            DebugFilter=TWAIN WIRE

 

Please note, the Source is designed to run in production mode with the Debug variable set to zero (0), two (2), four (4) or six (6); any other value will adversely affect the performance of the Source and most likely use a great deal of disk space.

 

 

3.4 ICAP_XFERMECH

The Source works best with an ICAP_XFERMECH of TWSX_MEMORY.  TWSX_NATIVE transfers and TWSX_FILE transfers with an image file format of TWFF_BMP require the Source to flip the image around the x-axis.  In all cases the Source is able to keep up with the rated speed of the scanner.  Efficiency is measured in terms of the number of amount of time left to do work on each image before the application must proceed to the next image. See ICAP_COMPRESSION for other restrictions.

 

 

3.5 KDSTST.EXE

This program is not meant for general use, it is a test tool that Eastman Kodak Company may use in the course of debugging user problems.  Users should not run this program unless directed to do so by Eastman Kodak Company. 

 

 

3.6 Custom Capabilities

The scanner supported by this Source provides some features and capabilities that go beyond what is described in the TWAIN Specification.

 

The header file describing these features is kdscust.h, which is installed in the %win%\twain_32\kodak\kds directory.  Developers should copy this file to their application build location, and use it to access the Source's custom features.

 

Note: the #include for this file is best placed immediately after the #include for twain.h

 

 

3.7 Force Compression

Most older TWAIN applications are only capable of processing uncompressed data.  The scanner is capable of delivering uncompressed images at its rated speed, however moving uncompressed data takes longer than moving compressed data, and there may be times when an application needs to get all the processing time that it can for its own operations.

 

Force Compression is a custom capability.  It is available both programmatically and in the GUI, however access to the GUI is turned off by default.  To activate it the user must edit the const.ini file and set the value of ForceCompression to 1.  This will result in the appearance of the ForceCompression option on the driver's Compression tab.

 

If ICAP_COMPRESSION is set to TWCP_NONE for a given camera, then Force Compression may be set to either TWCP_GROUP4 (for bitonal cameras) or TWCP_JPEG (for color cameras).  When this is done the Source will force the scanner to use the specified compression, but will internally decompress the image and pass along the uncompressed data to the application.  If the value of ICAP_COMPRESSION is set to anything other than TWCP_NONE, then the value of ICAP_FORCECOMPRESSION is ignored, no matter what its current setting.

 

Users should only activate this option if they are working with uncompressed data and are seeing the scanner transport pausing because of buffer full conditions.  Force Compression allows smaller images to be passed across SCSI, but at the cost of more processing per image as it decompresses each one before passing it to the application.  For this reason Force Compression is only recommended for fast machines with a generous amount of RAM.

 

From the application's point of view the Source has been set to obtain uncompressed data, and that is what it delivers.  At no time does an application have to be aware that force compression is in effect (unless it is driving the use of this feature programmatically).

 

Also, please note: Group4 compression is lossless, the decompressed images are exactly the same as if they had been scanned uncompressed.  JPEG compression is lossy; the decompressed images are NOT exactly the same as if they had been scanned uncompressed.

 

i800 series:  These scanner models are only capable of outputting JPEG compressed images, so ForceCompression is the only way to get uncompressed images from the Source.  Therefore ForceCompression is activated at all times for these scanners.  Support for uncompressed images is provided to maximize the base of supported TWAIN applications, but it is not a recommended mode for use with the i800 scanners, which are capable of producing huge amounts of large color images very quickly.

 

 

3.8 Force Version (3590 only, 1.x firmware)

The JFIF files created by the scanner currently have an embedded revision of 1.2.  If an application is using an ICAP_XFERMECH value of TWSX_FILE to transfer the images with a file format of TWFF_JFIF, then the JFIF files created by the scanner are dumped straight to disk.  In some rare cases there may be applications that have problems with the embedded revision value.  If this situation is encountered it is possible to change the value of the revision to 1.1 through use of ForceVersion.  The value should be added to the const.ini file after the occurrence of ForceCompression and should have the value of:  ForceVersion=257

 

 

3.9 Force Resolution (3590 only, 1.x firmware)

The JFIF files created by the scanner currently have an embedded unit of 0, with the density fields used to indicate a square aspect ratio.  If an application is using an ICAP_XFERMECH value of TWSX_FILE to transfer the images with a file format of TWFF_JFIF, then the JFIF files created by the scanner are dumped straight to disk.  In some cases there may be applications that want to know what the scanned resolution of the image was. If this situation is encountered it is possible to have the Source tweak the header so that the units field is set to 1 (dots per inch) and the density fields are set to the value of ICAP_XRESOLUTION/ICAP_YRESOLUTION for the image.  This alternate behavior may be activated through use of ForceResolution.  The value should be added to the const.ini file after the occurrence of ForceCompression and should have the value of:  ForceResolution=1

 

 

3.10 ICAP_PIXELTYPE (3590/4500/i200/i600/i700/i820/i840/i900/i1100/i1200/i1300/i1400/i1800/i2000/i2900/i3000/i4000/i5000)

The 3590C uses ICAP_PIXELTYPE to switch between the /Camera_Bitonal_Both and the /Camera_Color_Top cameras (it's still possible to do this with the DAT_FILESYSTEM command, if necessary).  ICAP_PIXELTYPE also switches the "Start in color mode" flag on the GUI back and forth (for the 3590 only, TWPT_BW turns it off, TWPT_RGB turns it on).

 

Please note that prior to 4.x ICAP_PIXELTYPE was not setting the CAP_CAMERAENABLE flag for the affected cameras.  The result is that the 3590 was the only scanner that performed correctly when setting ICAP_PIXELTYPE. 

 

Beginning with 4.x CAP_CAMERAENABLE is set for the affected cameras, and the GUI will reflect the current setting of ICAP_PIXELTYPE by placing the selection on the appropriate camera.

 

Setting ICAP_PIXELTYPE has the following affect in 4.x and higher:

 

ICAP_PIXELTYPE

Cameras Enabled*

Cameras Disabled*

New FileSystem

ICAP_GRAYSCALE

ICAP_BITDEPTH

TWPT_RGB

Color Front/Rear

Bitonal Front/Rear

/Camera_Color_Both

FALSE

24

TWPT_GRAY

Color Front/Rear

Bitonal Front/Rear

/Camera_Color_Both

TRUE

8

TWPT_BW

Bitonal Front/Rear

Color Front/Rear

/Camera_Bitonal_Both

FALSE

1

*Cameras Enabled -> CAP_CAMERAENABLE = TRUE

 

Do not to mix ICAP_PIXELTYPE with DAT_FILESYSTEM, CAP_CAMERAENABLE, ICAP_GRAYSCALE.  If the above table represents desired settings, ICAP_PIXELTYPE is the easiest way to get the desired outputs.  Otherwise use DAT _FILESYSTEM, CAP_CAMERAENABLE, and ICAP_GRAYSCALE to negotiate which output streams to receive.

 

Setting ICAP_GRAYSCALE will change the ICAP_PIXELTYPE and ICAP_BITDEPTH settings for that camera, but not change the current file system or enable/disable cameras.

Setting ICAP_BITDEPTH will change the ICAP_PIXELTYPE and ICAP_GRAYSCALE settings for that camera, but not change the current file system or enable/disable cameras.

Please reference TWAIN_ProgrammaticControl.htm for which settings are valid on which file systems.

 

 

3.11 Width and Length Alignment

The Kodak Document Scanners require the width of all images to be aligned on 16-bit boundaries.  It requires the height of color images to be aligned on 8-bit boundaries.  The Source provides this on behalf of the user, but needs to go beyond it to 32-bit width alignment for some image transfer modes.

 

The table breaks this down, showing the required alignments for the width and the height for bitonal and color images for each transfer mode.  Again, the Source will make these corrections for you, after negotiation, when the values are downloaded to the scanner.  The width and height dimensions returned by DAT_IMAGEINFO will reflect the final adjustments:

 

ICAP_XFERMECH &                Bitonal Alignment            Color Alignment

ICAP_COMPRESSION               Width x Height               Width x Height

TWSX_MEMORY

  TWCP_NONE                     16 x 1                       16 x 8

  TWCP_GROUP31D                 16 x 1                       n/a

  TWCP_GROUP32D                 16 x 1                       n/a

  TWCP_GROUP4                   16 x 1                       n/a

  TWCP_JPEG                     n/a                          16 x 8

 

TWSX_NATIVE

  TWCP_NONE                     32 x 1*                      32 x 8*

 

TWSX_FILE

  BMP

    TWCP_NONE                   32 x 1*                      32 x 8*

  TIFF

    TWCP_NONE                   32 x 1**                     32 x 8**

    TWCP_GROUP31D               16 x 1                       n/a

    TWCP_GROUP32D               16 x 1                       n/a

    TWCP_GROUP4                 16 x 1                       n/a

    TWCP_JPEG                   n/a                          16 x 8

  JFIF

    TWCP_JPEG                   n/a                          16 x 8

 

* - DIBs must be aligned on LONG (32-bit) boundaries.

 

** - TIFF can handle 16-bit alignment, but because the image format can be selected after the image is scanned the Source has to protect itself and default to 32-bit alignment.  This behavior can be overridden by going into CONST.INI and adding the line:

             ForceAlignment=1

Under the [dsIdentity] section.  This will allow for 16-bit aligned TIFF files to be created.  Note, however, that doing this will result in 16-bit aligned images if the format is changed to BMP.

 

Note: At 150 DPI it is not possible to get exactly 12" of width or 26" of height.  And, since it is not possible to exceed these values, in this case the Source automatically truncates down to the nearest alignment boundary (as appropriate) in order to produce correct images.

 

Note: Auto cropped images may result in output that is 16-bit aligned.  The Source will correct these for uncompressed data, but will take no action on compressed images.  In this latter case the necessary correction must be taken by the application.

 

 

3.12 Polarity

Polarity on the IMAGING tab is a misnomer.  The field shows the current setting of ICAP_PIXELFLAVOR, with "Black on White" corresponding to TWPF_CHOCOLATE (the

default), and "White on Black" corresponding to TWPF_VANILLA.

 

The breakdown of what this means for uncompressed images is as follows:

 

                                    white pixel         black pixel

TWCP_CHOCOLATE     1                      0

TWCP_VANILLA            0                      1

 

Unfortunately, in the case of images compressed with TWCP_GROUP31D, TWCP_GROUP32D and TWCP_GROUP4, the sense (as perceived by most viewers) has to be as follows:

 

                                    white pixel         black pixel

TWCP_CHOCOLATE     0                      1

TWCP_VANILLA            0                      1

 

This becomes most apparent for images transferred using TWSX_FILE with an image file format of TWFF_TIFF.  Many viewers ignore the PhotometricInterpretation tag, so that a correctly constructed TWCP_CHOCOLATE image is shown as white text on a black background.

 

The problem goes further.  Developers who wish to transfer the image in buffered memory mode would like to see the *decompressed* image reflect the setting they made with ICAP_PIXELFLAVOR.  The most obvious solution would be to change the behavior of ICAP_PIXELFLAVOR to do one thing with TWSX_MEMORY transfers and the other with TWSX_FILE transfers, but this would penalize those viewers capable of correctly handing the TIFF PhotometricInterpretation tag.

 

The current solution has been to preserve the legacy behavior, but add a new variable to the CONST.INI file.  This variable is called OldPolarity, and if set to 0 (OldPolarity=0) it will cause compressed images to support the use of ICAP_PIXELFLAVOR.

 

Application developers:

The value to send for ICAP_PIXELFLAVOR is not different based on the compression you desire. If the desire is to have zero represent black pixels then send TWCP_CHOCOLATE. If the desire is to have zero represent white pixels then send TWCP_VANILLA.  Of course, that is just how the raw data is returned to the application. When the application saves the data to a TIF file, the application needs to make sure it sets the TIF Photometric tag appropriately. For uncompressed images, the tag always needs to be one; this will give 'normal' images for Chocolate and inverted images for Vanilla.  For compressed images, the tag always needs to be zero; this will give 'normal' images for Chocolate and inverted images for Vanilla.  This difference has to do with how the Group IV spec says it interprets the data.

 

  

3.13 Feeder Keep Alive (3000/4000 Series)

Feeder keep alive addressed the situation of the transport timing out before any paper was scanned.  With this value set to TRUE the Source restarts the transport, allowing the session to wait forever for the first sheet.  Feeder keep alive was set to TRUE by default.  This was done because the Source had no way of telling the application that the transport had halted, which meant that the application would sit forever, waiting for an image that would never come (and thereby forcing it to implement its own timer mechanism to declare a session ended).

 

Starting with version 1.2.8 there is a mechanism in place that allows the Source to abort the session.  It works in the same way as Jam and Multifeed events.  This new mechanism is only in effect if CAP_FEEDERKEEPALIVE is set to FALSE.  If it is set to TRUE, then the legacy behavior will occur (transport running forever).

 

When CAP_FEEDERKEEPALIVE is set to FALSE, the Source will monitor the feeder, and if it stops, then it will issue a MSG_XFERREADY to the application, pretending that an image has been captured.  If the Source issues a request for DAT_IMAGEINFO, then the Source will make up to info from the negotiated capabilities.  When the application goes to transfer the image, then the Source will immediately report TWRC_CANCEL, which aborts the session.

 

 

3.14 Length Detection and Frames (3000/4000 Series)

Length detection is used to spot multifeeds.  The user selects the size of the document (off of the Multifeed tab), and if the scanner detects an attempt to scan anything larger than this value then it will alert the user.

 

Since TWAIN does not have the concept of document sizes and frames (it just has frames), there is no standard way for the Source to know what the size of the paper is going to be.  So it does the next best thing by preventing the user from selecting a length that cuts through any of the frames.  Consider three frames (FB, RB, FC) on the scanning bed (S).  The color frame is the bottommost of the set, so it determined the minimum non-zero value for length detection, as shown by the =========.

 

      +-----+----+---------+

      |S    |FB  |         |

      |     |    |         |

      |     +----+         |

      |                    |

      |   +----+           |

      |   |RB  |           |

      |   |    |           |

      |   +----+           |

      |                    |

      |          +----+    |

      |          |FC  |    |

      |          |    |    |

      |          +----+    |

      ======================

      |                    |

      |                    |

 

(Please note that the frames are not labeled in the real GUI, however it is possible to determine which frame goes with which camera by right clicking on the line of the box and selecting "What's This?")

           

The Front Color (FC) frame will prevent the length line from being less than itself, even if it is not possible to scan with color (start in color and patch enable are both off).

 

If the user wants to have a length detection line that reflects the bitonal documents only, and does not plan to scan in color, then the FC box needs to be moved or made smaller...

 

      +-----+----+---------+

      |S    |FB  |         |

      |     |    |  +----+ |

      |     +----+  |FC  | |

      |             |    | |

      |   +----+    +----+ |

      |   |RB  |           |

      |   |    |           |

      |   +----+           |

      |                    |

      ======================

      |                    |

      |                    |

 

 

3.15 MSG_STOPFEEDER Operation

TWAIN 1.9 provides a way to abort scanning without losing images when CAP_AUTOSCAN is TRUE.

 

DG_CONTROL / DAT_PENDINGXFER / MSG_STOPFEEDER may be issued in State 6.  When called it will cause the device's feeder to stop running, but it will in no other way affect the session.  With the feeder stopped, the Source will eventually transfer all the images from the device's buffers, and then the session will exit normally, dropping back down to State 5.

 

Note: using DG_CONTROL / DAT_PENDINGXFER / MSG_RESET will not only cause scanning to stop, it will strand any images remaining in the scanner's buffers.

 

 

3.16 JPEG Quantization (3590/4500/i820/i840/i200/i600/i700/i900/i1100/i1200/i1300/i1400/i1800/i2000/i2900/i3000/i4000/i5000)

WARNING: This section deals with settings that can degrade image quality.  Do not use this feature unless you clearly understand all the implications.

 

There are three ways of selecting the JPEG Quantization.

1) From the Source's GUI

2) Using DAT_JPEGCOMPRESSION

3) Using ICAP_JPEGQUALITY

 

The Source's GUI uses information defaulted in the driver to select the JPEG Quantization tables downloaded to the scanner.  These values can be overridden in the CONST.INI file by adding a line like the following:

 

            JpegQuantization_Y_50=12121212171E2630121212141921283...

            JpegQuantization_CbCr_50=1212121214191E2312121417191E...

 

The Y value selects the Luma value, and the CbCr value selects the Chroma.  40=draft, 50=good, 80=better, 90=best and 100=superior.  The names for these are defined in each of the language .ini files.  If a new entry is created:

 

            JpegQuantization_Y_10=8888888888888888888888888888888...

            JpegQuantization_CbCr_10=8888888888888888888888888888...

 

Then it will show up as "10%" (without the quotes) in the JPEQ Quality dropdown.  The available range of values is from 0 to 100 in steps of 5.  Note that 100% does not correspond to a true loss-less JPEG image, though it does select a value that minimizes the amount of loss.

 

ICAP_JPEGQUALITY uses these same values, so that the same tables can be obtained programmatically, and will be reflected in the GUI settings, if the Source's GUI is raised.

 

DAT_JPEGCOMPRESSION is the older method of controlling JPEG compression.  Instead of selecting an arbitrary 'quality' number, this operation directly downloads a JPEG Quantization table to the scanner.  Any time that this happens the Source will set ICAP_JPEGQUALITY to TWJQ_UNKNOWN, which will show up at "(application)" in the Source's GUI.  This setting indicates that the Source does not know the current quality setting for the JPEG Quantization.

 

If the user selects this value from the Source's GUI, then it will select the values last set by DAT_JPEGCOMPRESSION.  If there are no values available, then it will leave the current settings unchanged.

 

 

3.17 Multiple Modes (5xxx/7xxx/9xxx series)

The following information has not been certified for production use.  It is presented for customers who wish to experiment with this feature.  It only applies to drivers certified for use with the 5xxx/7xxx/9xxx scanners.

 

The 'Gemini' scanners 500/500A/900/923/990/5xxx/7xxx/9xxx support 18 modes.  TWAIN in general has no elegant way of dealing with this kind of complexity, and experience has shown that the majority of applications do not need it.

 

Still, there may be some users who absolutely require more than one mode.  The Source provides support for this in a few ways.

 

CAP_MODE selects which mode will be the current mode when scanning begins.  In a default configuration the user can select one of the modes (1 - 18); once selected they are locked into that mode for that scanning session.  Changing the mode on the scanner console and scanning paper with it results in the Source generating an error.

 

The ForceAcceptMode in the CONST.INI file under the [dsIdentity] section can be used to force the Source to support more than the ICAP_MODE.  The value is a bit mask with bits 1 - 18 corresponding to those modes that the Source will be forced to accept images from.  Note, though that forcing this behavior is not enough.  If the selected mode has not been setup properly its use can result in unexpected behavior, corrupt images or crashing of the application.

 

The DG_CONTROL / DAT_USERINTERFACE / MSG_SETUPDS command can be used to set up multiple modes.  The command sends the session attributes to the current CAP_MODE, but does not initiate scanning.  This allows the application to set as many modes as it needs prior to issuing MSG_ENABLEDS to begin image capture.

 

The DG_CONTROL / DAT_PASSTHRU / MSG_SET and MSG_GET can be used to control aspects of the scanner that are not explicitly described by the Source.  Use of this command is not casually recommended.  Users who believe that this is the only solution should contact Eastman Kodak Company before attempting to use it.

 

 

3.18 DAT_EXTIMAGEINFO

Please reference the TWAIN_ExtImageInfo.htm found in the KODAK directory.

 

3.19 ICAP_FRAMES

There are no requirements in the TWAIN spec around when ICAP_FRAMES should be available.  Therefore limiting it at any time could potentially break customers.  When a custom capability renders ICAP_FRAMES invalid (e.g. ICAP_CROPPING mode set to TWCR_AUTOMATICBORDERDETECTION or TWCR_AGGRESSIVEAUTOCROP), MSG_SET and MSG_RESET will still be available (i.e.  frames will be disabled on the screen, but allowed full access programmatically).

 

3.20 Color Dropout: Enhanced Processing

Due to hardware constraints it is not possible to have enhanced color dropout on one camera and normal color dropout on another.  Any changes to enhanced processing for one camera will automatically be effected on the other.

 

3.21 i30/i40 Button Mapping

In order to add an application to send button events to, you must add the application to the registry at:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\StillImage\Registered Applications

 

3.22 Displaying Scanner Operator/Info Log

For those scanners that support it, an application can negotiate the custom CAP_LOG capability, setting it to TWLH_OPERATOR.

They can then issue a custom DG_CONTROL / DAT_USERINTERFACE / MSG_ENABLEINFO, which will bring up the UI with just the INFO tab, set to the Operator Log.

#define CAP_LOG               0x8082

#define    TWLH_OPERATOR      1

#define    TWLH_INFO          5

 

 

4.0 Known Issues

This section reports known issues with the Source.

 

 

4.1 Programmatic Constraints

The Source does not currently protect itself from certain combinations of programmatic access.  For instance, it is possible to set ICAP_CONTRAST and ICAP_THRESHOLD when ICAP_HALFTONES is set to one of the dithering algorithms.  This behavior does not affect the ability of the scanner to scan or the quality of its images; however, if an application is relying on the unavailability of capabilities to control its own GUI sensitivity, then this problem may become a factor.

 

 

4.1.1 ICAP_COMPRESSION

Compression is properly constrained based on the current value of ICAP_XFERMECH:

 

ICAP_XFERMECH        ICAP_COMPRESSION

TWSX_NATIVE          TWCP_NONE**

 

TWSX_FILE            TWCP_NONE, TWCP_GROUP31D*,

                     TWCP_GROUP32D*, TWCP_GROUP4,

                     TWCP_JPEG

 

TWSX_MEMORY          TWCP_NONE, TWCP_GROUP31D*,

                     TWCP_GROUP32D*, TWCP_GROUP4,

                     TWCP_JPEG

* - i800 only 

** - accepts other valid values but resets to TWCP_NONE automatically

 

The Source does not currently protect against compressions other than TWCP_NONE if the TWSX_FILE image format is TWFF_BMP, (this error test will be added to the DG_CONTROL / DAT_SETUPXFERFILE / MSG_SET in a later version).

                       

Because of this dependency, the Source does not remember the last setting of compression, but will always default to TWCP_NONE (because the Source's power on default for ICAP_XFERMECH is TWSX_NATIVE).

 

This can be annoying for users working with Applications that rely solely on the Source's GUI.  If the user wishes to use any compression other than TWCP_NONE then they must reset it each time the Source is restarted.

 

A workaround is available in this release.  Users wishing to override the default behavior may do so by editing the const.ini file, going to the [SkipDependency] section, and changing the value of ICAP_COMPRESSION from 0 to 1.

 

Please note, making this change may cause unwanted behavior with Applications that do not rely on the Source's GUI.  If unexpected side-effects occur then reset the value back to 0.

 

The Source protects itself when the ICAP_XFERMECH is TWSX_NATIVE by always setting the compression to  TWCP_NONE.

 

 

4.2 Delay with MSG_ENDXFER

Programmers will notice that if there is no paper in the scanner's feeder the TWAIN message DG_CONTROL / DAT_PENDINGXFERS / MSG_ENDXFER will not return until the transport timeout occurs.  This is a part of the design of the Source, since the scanner cannot properly determine how to set pTW_PENDINGXFERS.Count until it scans the next piece of paper or the transport times out.  Users requiring MSG_ENDXFER to be more responsive must use a smaller transport timeout value.

 

Beginning with version 3.x there is a programmatic workaround for this problem using the custom CAP_NOWAIT capability.  Setting this value to TRUE will result in any blocking call immediately returning TWRC_BUSY until the request is complete.  See the KDSCUST.H file for more information.

 

 

4.3 Fix for Overscan (3xxx Series)

Firmware 1.0.21 of the 3500 has a bug in overscan.  If the top and bottom sides are set to overscan and scanning is done, and then the top and bottom sides are set to no-overscan and scanning is done, then it will be noticed that the bottom image has done top overscan, even though the scanner has been set to no top overscan and reports no top overscan.

 

The Source gets around this problem by downloading the bottom settings twice.  This behavior is controllable from the CONST.INI file in the [ICAP_OVERSCAN] section under the FixOverscan flag.  The default value for the flag is 1, which is what causes the rear to be downloaded twice.  There is no measurable performance benefit from setting this flag to 0, so it should remain at 1, even if the user does not use overscan.

 

Update:  As of firmware (3500 v1.1.4, 3510 v1.0.10, 3590 v1.0.6) this problem was fixed.  So, starting with version v1.2.5 of the Source the FixOverscan flag will default to 0.

 

 

4.4 DEFAULTS button does not affect the following...

Pressing the DEFAULTS button on the GUI will reset most of the capabilities to their default settings, with the following exceptions (note that not all of these values are present in the Source's GUI):

 

CAP_DEVICEEVENT

CAP_DEVICEONLINE

CAP_DEVICETIMEDATE

CAP_DISABLEFIELDINUI

CAP_MAXBATCHBUFFERS

CAP_NOWAIT

CAP_SCSIADAPTERTARGET

CAP_SERIALNUMBER

ICAP_IMAGEFILEFORMAT

ICAP_XFERMECH

 

 

4.5 TIFF JPEG (3590/4500/i820/i840/i600/i700/i200/i900/i1100/i1200/i1300/i1400/i1800/i2000/i2900/i3000/i4000/i5000)

This Source provides support for TIFF/JPEG images (accessed by specifying a value of TWSX_FILE for ICAP_XFERMECH, specifying TWCP_JPEG for the value of ICAP_COMPRESSION, and requesting TWFF_TIFF for the file format when calling DAT_SETUPFILEXFER).

 

The resultant image is generated following the "TIFF Technical Note #2".  The following is a dump of a sample image created using the scanner simulator.

 

Reading file: i0000002.tif

The file size is 21690 bytes.

Intel (little endian) byte order

IFD OFFSET = 8

The number of tags = 16

Tag                               Type            Length          Value

254 New Subfile Type              LONG            1               0

255 Subfile Type                  SHORT           1               1

256 Image Width                   LONG            1               832

257 Image Length                  LONG            1               1176

258 Bits Per Sample               SHORT           3               <206> 8 8 8

259 Compression                   SHORT           1               7

262 Photometric                   SHORT           1               6

273 Strip Offsets                 LONG            1               252

277 Samples Per Pixel             SHORT           1               3

278 Rows Per Strip                LONG            1               1176

279 Strip Byte Counts             LONG            1               21438

282 X Resolution                  RATIONAL        1               <212> 100 / 1

283 Y Resolution                  RATIONAL        1               <220> 100 / 1

296 Resolution Unit               SHORT           1               2

530 YCbCr Sub-sampling            SHORT           2               2 2

532 Reference Black White         LONG            6               <228>

 

Items of note include the following.  Compression is set to '7', per Note 2.  JPEG Compression in TIFF v6 was set to a value of '6'.  Photometric interpretation is set to 6, which indicates YCbCr for the JPEG encoding.  Finally, the YCbCr Sub-sampling is present, and set to 2 2.

 

Prior to this release the TWAIN Source attempted to follow the TIFF v6 guidelines for TIFF/JPEG generation.  Since "Note #2" depreciates that part of the TIFF v6 spec, this "Note #2" method comprises the only 'standard' way of generating TIFF/JPEG images.

 

It is still possible to get the TWAIN Source to create TIFF/JPEG images in the older style.  Please contact your Eastman Kodak Company representative if you absolutely have to have this feature.

 

 

4.6 Scanner Does Not Always Report Jams (5xxx/7xxx/9xxx)

The 5xxx/7xxx/9xxx series of scanners with Document Image Management may not always report jam conditions to the TWAIN Source.  Scanners without the Document Image Manager always correctly report the occurrence of the jam.

 

Pressing the End Of Job button on a 9000 series scanner will usually flush the jam error to the TWAIN Source.

 

TWAIN sessions with 5000/7000 series scanners will appear to end normally, as if the session had been terminated by the operator.

 

Jams are always reported on the scanner console, so operators are encouraged to go there to learn the reason for unexpected stoppages during a scanning session.

           

 

 

5.0 Acknowledgements

This section acknowledges code used by other vendors in the development of this TWAIN driver.

 

 

5.1 Intel(r) JPEG Library

The Intel(r) JPEG Library (IJL) is a high performance API for compressing/decompressing JPEG images.  Information on it can be obtained at Intel's website: http://developer.intel.com

 

 

5.2 Picture Elements(tm) ChromaTHR(tm), 3590/4500, 4.x only

Picture Elements(tm) software converts color images to bitonal using their ChromaTHR(tm) technology.  Hardware support may be purchased from them by customers requiring higher quality images at production scanner speeds.  For more information, please refer to the Picture Elements website: http://www.picturel.com