Clientside Demo of Automatic Document Feeder use with csXImage in Javascript

To run this demo you need the csXImage trial ocx control installed on your system as well as MS Internet Explorer. The trial control and the example file are available below:

Download the trial csXImage control - csXImageTrial.exe (3 MB)

The example web page, with instructions - (3 KB)

The ActiveX control csXImage includes a range of functions to acquire images from TWAIN compliant devices such as scanners and webcams. It can be used with a scanner that has an Automatic Document Feeder (ADF).

Use of an ADF is demonstrated with this simple Javascript application. The application consists of a single web page containing an instance of csXImage and some radio buttons and checkboxes. The formatting and Javascript coding has been kept to a minimum to make it easier to understand.

The scanned images are saved to file on the local disk. Three radio buttons are provided for the user to select the method for file saving. Each option demonstrates a different way of handling the multiple images being received by the control. The status of the radio buttons is checked in the function 'csxiacquire' that is called by the OnAcquire event and used to call the appropriate code.

The first option is for the images to be saved as individual files. A variable (filenum) is used as a counter and the images are saved as demo1.tif, demo2.tif, etc.

The second option adds each image to a multi-page TIFF file using the AddToTIF function. When scanning is finished this file is saved.

The third option makes use of the IsBlank property of the control to detect blank pages. Each group of images separated by blank pages is saved as a multi-page TIFF file. The AddToTIF function is used and the counter filenum is again used to increment the file number.

Checkboxes are provided so that the user can select whether or not duplex scanning should be enabled and whether or not the user interface of the scanner should be used. If the interface is not used, the scanning will proceed using default settings for colour depth, resolution etc.

A longer description of this demo is provided in the ReadMe.txt file included in the download.

More on using csXImage as a clientside control in the browser.