|
|
От: |
febus
|
|
| Дата: | 18.10.06 12:59 | ||
| Оценка: | |||
Question: How can I configure from my Application and Data Source to scan duplex and what special considerations would apply to transfer these duplex images?
Answer: From the TWAIN application's point of view the duplex scanning, once enabled, is the same as multi page scanning. Duplex can be enabled (for devices and Data Sources supporting it) either programmatically using CAP_DUPLEXENABLED or from the Data Source GUI.
The application can check the CAP_DUPLEX value to know if duplex is supported and what duplex mode is supported by the device (one pass or two pass duplex).
Before setting CAP_DUPLEXEMABLED to True the application may need to enable the document feeder setting CAP_FEEDERENABLED (and CAP_AUTOFEED for automatic document feeding) to True and set CAP_XFERCOUNT to either -1 or a multiple of 2 value.
During a multi page duplex transfer sequence the application can keep record of which paper side (front or back) is being transferred by counting the images transferred so far (and assuming the first one was front side). Some Data Sources do implement custom capabilities or extended image information support to let the application know which side is about to be transferred next, is transferred currently or was just transferred (in the extended image information case).
Some Data Sources supporting duplex may also support different File System camera devices (which can be selected by the application through DG_CONTROL/ DAT_FILESYSTEM/ MSG_CHENGEDIRECTORY) so certain capabilities can be negotiated separately for each scan side (front and back) (e.g. there are duplex scanners that support different scaling, resolution, even pixel type for the front and back side). By default all these capabilities are negotiated for the "default camera", that is the scanner (i.e. for both front and back sides). Usually when such functionality is supported, it is available also from the Data Source GUI (to allow the user to select different scan parameters for the front and back sides). The application shall use DG_IMAGE/ DAT_IMAGEINFO/ MSG_GET in state 6 before a new image transfer to know the image attributes (such as image dimensions, bit depth, pixel type, compression).