This topic contains 0 replies, has 1 voice, and was last updated by Jon 3 weeks, 6 days ago.
July 27, 2017 at 10:54 am #30341
Is it possible for a newer flatbed scanner to use an older version of Twain?
Previously using HP8300 was used to scan images. Since upgrading to the Canon CanoScan LiDE 210/220 it expects Twain 2.1 and above if I specifically select the Twain driver (it works fine with WIA). After returning the failure code (1) I look up the corresponding status and see TWCC_CAPBADOPERATION (Operation not supported by capability).
According to http://www.twain.org/wp-content/uploads/2016/03/TWAIN-Errata-for-Version-2.1.pdf
on page 15
it looks like the way we are to SET the capability has changed since Twain 1.8. In my case I was trying to set the x-value to 300 in relation to the scan resolution:
“DG_CONTROL / DAT_CAPABILITY / MSG_SET It was made available for TWAIN 2.0 for DS to return TW_ENUMERATION for type TW_BOOL. The intent was to make this mandatory for TWAIN 2.0 DS but this was not made clean enough. Starting with TWAIN 2.1 Capabilities of type TW_BOOL require the datasource to use TW_ENUMERATION when talking to TWAIN 2.x applications but continue to use TW_ONEVALUE when talking to 1.x applications. Chapter 8 for each capability of type TW_BOOL should explain it needs to return TW_ONEVALUE when talking to 1.x and TW_ENUMERATIONS when talking to TWAIN 2.x applications. Ideally, the Specification should be completely free of version and operating system dependencies. The reality is that we have several dependencies, and that in terms of the Spec they are scattered across the document. I recommend that we remove all version and OS dependent comments, and attempt to consolidate them into two sections within the Spec. I think a new chapter is appropriate: Version and Operating System Dependencies. Any parts of the main spec that currently talk about dependencies of this sort should either be removed or referenced to this chapter. Container for MSG_GET: TW_ONEVALUE, // for backwards compatibility with 1.x only TW_ENUME
TW_ONEVALUE needs to be changed to TW_ENUMERATION in all cases.”
So it looks like all the code we have talking with Twain is out of date for this particular project and needs to be updated.
OR… is there some way for me to get the scanner to use a lower version of Twain? I doubt it, but figured I’d ask anyway (e.g. thinking running a windows application in compatibility mode for an earlier version of the OS, etc).