Production Scanning WIA 2.0 Driver Sample

[This is preliminary documentation and subject to change.]

SUMMARY

This driver sample shows how to add Production Scanning features to a WIA
2.0 mini-driver.

The sample driver implements the following programmable data source items
and related functionality:

·
Flatbed and Feeder, which both support 8-bpp
grayscale, 24-bpp RGB, Auto-Color, and implement necessary WIA property support
for Auto-Crop, Over Scan and Color Dropout.

·
Auto item, for Auto-Configured Scanning. The
Flatbed, Feeder and Auto items all support the DIB, EXIF and RAW image transfer
file formats.

·
Additionally the Feeder item implements the
necessary properties and commands demonstrating Job Separators, Long Document
Scanning, Blank Page Detection, Multi-Feed Detection, Scan Ahead, and Feeder
Motor Control.

·
The Job Separators and Multi-feed Detection
functionality is simulated at predetermined scan page numbers.

·
Imprinter and Endorser, which both support text
and graphics bi-directional data transfers. Transfer formats supported are DIB
(for graphics), TXT and CSV (for text).

·
Barcode Reader, Patch Code Reader and MICR
Reader, which all support XML and RAW metadata download.

·
Full configuration for the standard scan event
as well as the device status events.

·
WIA trace
instrumentation, including real-time sample scanning performance (Pages per
Minute, PPM) measurement.

NOTES

This sample requires WIA 2.0, thus the sample will work only on Windows
Vista and higher releases.

The default test images for Flatbed, Feeder and the Auto source are a pair
of EXIF images loaded from resources, each in size of 2550 x 3300 pixels,
equivalent with a Letter document (8.5” x 11”) scanned at 300 DPI. The sample
uses GDI+ to convert these test images to DIB. The sample RAW images are obtained
from the DIB conversions.

The default test image for the Imprinter and Endorser is 640 x 480 pixels, 1-bpp
DIB loaded from resources. The WIA application can individually replace the
Imprinter and/or Endorser image for the current driver instance by uploading at
run time other 640 x 480 pixels, 1-bpp, DIB images.

By default the sample reports to support a single standard
document size (WIA_PAGE_LETTER), which matches the test images that the sample
by default transfers. The sample also reports to support WIA_PAGE_AUTO and
WIA_PAGE_CUSTOM. The default scan area size can be changed by modifying the MIN/MAX_SCAN_AREA_WIDTH/HEIGHT values
in Constants.h and rebuilding the sample: the sample will still transfer the
same test images but will report as supported for the Feeder all standard WIA document
sizes that fit into the simulated scan area minimum and maximum dimensions.

When job separator detection is enabled the sample simulates
a job separator page every 3 pages. This number can be modified by editing the
JOB_SEPARATOR_AT_PAGE value in Constants.h and then rebuilding the sample.

When multi-feed detection is enabled the sample simulates a multi-feed error
every 5 pages. This number can be modified by editing the MULTI_FEED_AT_PAGE
value in Constants.h and then rebuilding the sample.

By default when scanning from the Feeder with WIA_IPS_PAGES is set to
ALL_PAGES and from the Auto item the sample will stop (pretending the feeder is
empty) after scanning 200 pages. For Feeder, if the application requests a
WIA_IPS_PAGE value greater than 200 the sample honors this request. The 200
page limit can be modified by changing the MAX_SCAN_PAGES value in Constants.h
and rebuilding the sample.

BUILDING THE SAMPLE

To build the sample, complete the following steps:

1.      On the Start menu, under Windows DDK, select Free Build Environment or Checked Build Environment to open a
command window and set basic environment variables needed to build drivers.

2.      Navigate to the
directory that contains the sample driver source code (that is, the directory
where this file is located).

3.      Run the build command.
After the build completes, the following DLL is built: ProdScan.dll.

INSTALLING THE SAMPLE

To install the sample, complete the following steps:

1. Open an
elevated command prompt and then type rundll32
sti_ci AddDevice.

2. When
prompted for which scanner or camera you want to install, click Have Disk, and then navigate to the
directory that contains the driver INF file (ProdScan.inf) and the DLL
(ProdScan.dll).

USING THE SAMPLE

The WiaInfo2 WIA tool can be used to test the sample. WiaInfo2 can display
all new programmable data source items, their properties, allow writable
properties to be changed, execute image and metadata download transfers as well
as upload data to the device.

RESOURCES

For information and the latest release of the Microsoft® Windows® Driver Kit
(WDK), see http://msdn.microsoft.com/en-us/library/ff557573.aspx.

For information about WIA, see http://msdn.microsoft.com/en-us/library/ms630368(VS.85).aspx.

For questions about WIA and this sample, send e-mail to [email-masked].