twain / twain-direct

Main TWAIN Direct repository
MIT License
30 stars 18 forks source link

Long document mode #17

Open petrjac opened 3 years ago

petrjac commented 3 years ago

Please, how I can set long document mode for receipts?

I was trying sending with Alaris S2070:

...
{
   "attribute":"cropping",
   "values":[
      {
         "exception":"fail",
         "value":"long"
      }
   ]
},
...

But this returns error:

{
  "kind": "twainlocalscanner",
  "commandId": "bbcc76c2-998f-4426-8e00-d0fd213199c5",
  "method": "sendTask",
  "results": {
    "success": false,
    "code": "invalidJson",
    "characterOffset": 60
  }
}
mlmcl62 commented 3 years ago

Oddly enough TWAIN doesn't have a standard way to specify long documents (or relative cropping, for that matter). There's a placeholder in the Bridge in case that's ever added. What you should probably do is contact the scanner vendor to see if they have any plans to support TWAIN Direct in their TWAIN driver. Then you'd have access to all of the features of the scanner, instead of depending on what the Bridge is capable of parsing.

I'm going to leave this open as a reminder that it would be nice to update TWAIN to support this...