|Top Previous Next|
The -details option writes information on all the installed TWAIN devices to the file specified by filename. This option should be used only for getting information on the devices, and not to acquire images. TwainSave will exit immediately after writing the details to the file filename and not attempt to acquire images
twainsave -details c:\scanner_details.txt
The example above writes detailed information about the installed TWAIN devices to "c:\scanner_details.txt". As with any parameters that may contain spaces, the filename must be enclosed in double quotes if the file name contains spaces.
twainsave -details "c:\My Folder\Scanner Info\details.txt"
Please note that TwainSave is constantly being revised to add additional information within the -detail log that does not appear in the table below. It is always best to generate a current detail log to determine if any additional information has been added that does not appear in the definitions below. In any event, the new definitions will be similar in syntax to the current definitions defined in the below table.
As of the writing of this manual, the information written to the file consists of:
The format of the data is as follows:
As a quick example, if there are two TWAIN devices installed, the following will be found in the details file.
If the product name of the device is "xyz scanner", the following will be found in the details file:
Since the format of the output generated is well-defined, the detail log can also provide programmers with a file that they can parse for certain values, and allow their programs to use the information. For example, a program can be written to execute TwainSave to generate the detail log, and from the log, determine what devices are functional, and also the various color and bits-per-pixel combinations that are valid for a particular device. Then TwainSave can be executed again with the color/bits-per-pixel information gathered from the detail log to ensure that images will be scanned with valid color and bits-per-pixel information.
For example, the detail log can be used to discover the valid color and bits-per-pixel information for each installed device. If the -color and/or the -bitsperpixel options are used when running TwainSave, they must be valid values. The detail log will indicate the valid color and bits-per-pixel values.
Here is the information for each of the items above:
Range and Discrete Types
For some of the details listed, a Range or Discrete set of values will be displayed. A Range is denoted by three values -- a minimum value, maximum value, and step value. For example:
The above means that the brightness values have a minimum of 10, a maximum of 1000, and that the other values are in increments of 5, starting from the minimum value. So the brightness values are 10, 15, 20, 25, 30, 35, 40, 45, etc.. up to 1000.
Ranges are basically a compact way to represent a lot of equally spaced values.
The Discrete set of values lists all of the different values possible. For example:
The above means that the contrast has 3 settings, namely 0, 50, and 100.
The Device_Resolution_Values contains two strings before the listing of the numerical resolution values. The first string is either Discrete or Range, as defined above. The second string denotes the unit of measure that the numerical values will be based on. So for example, the following denotes a device that has resolution values of 100, 200, 300 DPI, and 100, 200, 300 dots per centimeter:
Note that each device listed may have one or more Device_Resolution_Type's listed, since a single device may have multiple units of measure supported.
The following unit abbreviations are used:
A sample detail log for three devices named "Device1", "Device2", and "Device3" would look similar to the following:
Device_Name:CanoScan LiDE 500F
Device_Name:TWAIN_32 Sample Source
Device_Name:Joe's Great Scanner
Device_OK:CanoScan LiDE 500F
Device_OK:TWAIN_32 Sample Source
Device_Failure:Joe's Great Scanner
Here is a breakdown of one of the scanners found, the "CanoScan LiDE 500F".
First, we know it was found, since it appears as one of the Device_Name types. We also know that it was opened successfully, since there is this:
Device_OK:CanoScan LiDE 500F
After the Device_OK line is the following color information:
The "CanoScan LiDE 500F" can acquire using three different -color settings, therefore there are three Device_Color_Info entries. The first Device_Color_Info setting describes the color and bits-per-pixel valid for color 0. For color 0, the valid bits-per-pixel used is 1. Similarly, the second Device_Color_Info describes the valid bits-per-pixel values for color 1, and the third Device_Color_Info describes the valid bits-per-pixel for color 2. The color value can be used in the TwainSave command-line option -color, and the bits-per-pixel can be used in the -bitsperpixel option.
For example, the following TwainSave command is valid for the CanoScan LiDE 500F scanner:
twainsave -filename test.bmp -color 1 -bitsperpixel 8
The next entries describe the various resolution values.
The "CanoScan LiDE 500F" can acquire resolutions using three different units of measure, namely Inch, CM (meaning centimeter), and Pica. Therefore there are three separate Device_Resolution_Type entries.
The first Device_Resolution_Type has the Range type, denoting that the resolution values listed on that line describes a range of values.
The values listed are 25, 9600, and 1. Since a Range type describes a minimum, maximum, and step values, the 25 denotes the minimum value of the range, the 9600 is the maximum value of the range, and the 1 denotes the step value. Therefore the valid resolution settings, given that the units are in inches are 25, 26, 27, 28, 29, ... up to 9600.
This line states that for units of centimeters, the valid resolution values are defined by the range starting from 9.843 up to 3780, with a step value of 0.3937.
This line states that for units of pica, the valid resolution values are defined by the range starting from 1 up to 1 with a step value of 1. This is basically stating that there is only a single value that can be set if the units are in pica's, namely 1.
The next line in the listing denotes the supported brightness values:
Note that the brightness values are stored in a Range. The minimum value in the range is -1000, the maximum value is 1000, and the step value used in the range is 7.874. This means that the following are valid brightness values: -1000, -992.126, -984.252, ... up to 1000 (the step value of 7.874 is added to each value).
The next line in the listing denotes the gamma values supported by the "CanoScan LiDE 500F":
Note that the type of values are Discrete, meaning that the values listed are the only values available. The only value listed is 2.26. This means that the gamma value is set for 2.26 and cannot be changed.
The next line in the listing denotes the available contrast values:
Note that this is similar to the brightness values.
The next three lines are:
These determine if the device supports hightlight, shadow, and threshold settings. Note that all three are supported, and that the values are defined in a range.
The next line denotes the paper sizes that are supported:
All of the supported paper sizes follow the Device_Paper_Sizes: text, and are comma separated. Therefore the CanoScan LiDE 500F supports "none", "A4", "B5", "letter", etc. sizes. Note that these sizes can be used in the -papersize option.
The final set of lines denote whether various aspects of the scanner are supported or unsupported:
According to the lines above, the "CanoScan LiDE 500F" supports a document feeder, there is no imprinter support, no duplex support, the user interface when acquiring images can be turned off by TwainSave's -noui command, no transparency unit, there is no job control support, there is no paper rotation support, and the device has an auto-brightness feature. Note that 1 in the listing above means "is supported", and 0 means "unsupported".
There is another listing in the details log for a device called the "Twain_32 Sample Source". Let's just go over some of the differences between what is listed for this device and what we saw previously with the CanoScan LiDE 500F scanner.
The Twain_32 Sample Source has only one color setting:
It only supports a color value of 2, but the bits-per-pixel can be either 8 or 24.
Note that the resolution values are represented as Discrete values:
This means that if the units are in inches, only one value can be used, and that is 100.
Also note that there is no gamma settings available for the "Twain_32 Sample Source":
There is also a third device that was found called "Joe's Great Scanner". Unfortunately, it either doesn't work, wasn't installed properly, or some other malfunction, since the following shows up:
Device_Failure:Joe's Great Scanner
This denotes that the scanner failed and cannot be used to acquire images. If this error occurs, it is for the reasons stated previously, namely the device wasn't installed properly, the software was installed but there is a malfunction in the device (maybe a cable is loose or not connected, or maybe the device is broken or missing), or some other software/hardware issue that TwainSave cannot solve.