0

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

PaulMcKenzie
  • 34,698
  • 4
  • 24
  • 45
Sam
  • 2,473
  • 3
  • 18
  • 29

1 Answers1

0

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).

PaulMcKenzie
  • 34,698
  • 4
  • 24
  • 45
  • Checking for flatbed is NOT redundant because there exists scanners that have ADF but no flatbed. For example [Fujitsu fi-7300](https://scanners.us.fujitsu.com/for-small-business/desktop/fi-7300nx). Also you mentioned `Check if CAP_FEEDERENABLED is supported`. How do you do that? – Sam Jan 07 '21 at 20:56
  • Like I mentioned, it either has a feeder, or it doesn't have a feeder. There is no standard TWAIN capability to check for "flatbed only". Second, doesn't LeadTools have an API that detects whether a capability is supported? (My [API](https://github.com/dynarithmic/twain_library) has such a function). – PaulMcKenzie Jan 07 '21 at 20:58