Eastman Kodak Company
WIA Readme File
01-March-2012
This directory contains information on Kodak’s WIA driver (e.g. custom properties).
This contains information on the custom properties exposed by Kodak’s WIA driver.
This contains information on how standard properties are used by Kodak’s WIA driver.
This contains information on generating debug information.
NOTE: It is suggested that you only generate debug information when instructed by Kodak support personnel.
Getting Started with WIA (on MSDN)
This link takes you to the WIA programming section on MSDN. This contains information on how to programmatically use a WIA driver. The Tutorial is a good place to start.
Finding the scanner’s model directory
Multiple places within the WIA document mention the scanner’s model directory. This section describes how to locate that directory.
All of the user files are found in the scanner’s model directory within the Operating System’s All Users directory:
XP: %ALLUSERSPROFILE%\Application Data\kds_kodak\modeldir
Vista/Windows 7: %ALLUSERSPROFILE%\kds_kodak\modeldir
Where:
%ALLUSERSPROFILE% is the actual path for the All Users directory (e.g. “C:\Documents and Settings\All Users”) and is different based on Operating System. To find out what it is for your operating system:
1. Open a command window (for XP: click on START, select RUN, type CMD, and then click OK)
2. Type: set ALLUSERSPROFILE
modeldir is the scanner’s model directory. Typically, this is “kds_” appended with the scanner’s series (e.g. kds_i1200).
WIA Automation
Microsoft provides a “full-featured image manipulation component that provides end-to-end image processing capabilities.” This component may be accessed from languages like C# or VB Script. It has some limitations. It works through the WIA 1.0 interface, and is not designed to handle duplex scanners.
Kodak provides a way around this using the const.ini file for its WIA driver. See the Debugging section for information on the location of the const.ini file. Make sure the following items are present in this file:
[dsidentity]
ForceVersion=1
ForceWiaAutomation=1
ForceReset=1
Please note that these settings may cause problems with some WIA applications, especially on Windows 7 and later. Do not set these values unless you must have duplex support for WIA Automation.
What follows is a sample VB Script showing how WIA Automation can be used running wscript from the command line:
' Variables...
Dim devmgr
Dim CommonDialog1
Dim dev
Dim itms
Dim itm
Dim img
Dim count
Dim filesys
Dim name
Dim info
Dim scannername
' The scanner we want to use...
scannername = "KODAK i2800 Scanner"
' Get our objects...
Set filesys = CreateObject("Scripting.FileSystemObject")
Set devmgr = CreateObject("WIA.DeviceManager")
Set CommonDialog1 = CreateObject("WIA.CommonDialog")
' Find our scanner...
For Each info in devmgr.DeviceInfos
If info.Properties("Name").Value = scannername Then
Exit For
End If
Next
If devmgr Is Nothing Then
MsgBox scannername & " not found..."
WScript.Quit
End If
' Connect to it...
set dev = info.Connect
' Pick the Scan item...
Set itm = dev.GetItem(dev.Items(1).ItemID)
' Configure Root...
dev.Properties("Document Handling Select") = 5 ' FEEDER | DUPLEX
dev.Properties("Pages") = 0 ' Scan all pages
' Configure Root/Scan...
itm.Properties("Data Type") = 0 ' Black & White
itm.Properties("Compression").Value = 0 ' NONE
itm.Properties("Horizontal Resolution").Value = 200
itm.Properties("Vertical Resolution").Value = 200
' Any attempt to change setting after this point will
' be ignored for the duration of scanning...
count = 0
Do
' Scan...
Err.Clear
Set img = CommonDialog1.ShowTransfer(itm, "{B96B3CAB-0728-11D3-9D7B-0000F81EF32E}", False)
' Handle errors and end-of-job...
If Err.Number <> 0 Then
If Err.Number = -2145320957 And count > 0 Then
'out of paper...
Else
MsgBox Err.Number & ": " & Err.Description
End If
Err.Clear ' Clear the error.
Exit Do
End If
If img Is Nothing Then
'User cancelled the scan
Exit Do
End If
' Save the image...
count = count + 1
name = "C:\temp\www" & count & ".bmp"
If filesys.FileExists(name) Then
filesys.DeleteFile(name)
End If
img.SaveFile(name)
Loop
' Report the result...
MsgBox "scanned " & count & " images..."