简体   繁体   中英

How to determine if a TWAIN Scanner is ADF/Flatbed, or Both

What is the best way to figure out if the current selected scanner is ADF/Flatbed, or Both using Leadtools SDK 20?
I know I can use L_TwainGetCapability() and L_TwainSetCapability() with CAP_FEEDERENABLED to enable/disable the feeder if it is there, but how can I determine if it has feeder (maybe it is a flatbed only) or has a flatbed (maybe it is ADF only) or has both?

Thank you
Sam

I have not used LeadTools, but the check for a flatbed is redundant if the device does not have a feeder. It either has a feeder, or it doesn't have a feeder.

Remember that a TWAIN device could be a digital camera, and not a scanner -- thus a "flatbed" doesn't make sense.

The current way that I check is to simply see if CAP_FEEDERENABLED is supported is the following:

  1. Check if CAP_FEEDERENABLED is supported. If not supported, then there is no feeder and you're done.
  2. If CAP_FEEDERENABLED is supported, save the current setting of CAP_FEEDERENABLED .
  3. See if setting CAP_FEEDERENABLED to TRUE is successful and save the results.
  4. Reset CAP_FEEDERENABLED with the value saved in step 2.
  5. The results saved in step 3 is the determining factor.

Unfortunately, this is the roundabout way I've done this, but it should work. This is basically described in the TWAIN Specification for CAP_FEEDERENABLED (the version of the specification I use is 2.4).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM