Multi page scanning twain using asp net framework 4.7.2

548 Views Asked by At

I have windows service self-hosted application that allow you to scan files or media through twain scan driver. Can someone help me to scan multi page file using ntwain nuget package?

1

There are 1 best solutions below

0
Gaurav On BEST ANSWER

You can follow below steps:

  1. Create a RESTful service and host it as a Windows service on the workstation where scanner is installed.
  2. Implement a Get API to return scanned pages. Remember that the API does not return immediately and rather waits on an AutoResetEvent (See C# reference on AutoResetEvent)
  3. NTwain triggers DataTransferred() event when all pages have been scanned. Raise a AutoResetEvent from within DataTransferred() event or SourceDisabled() event. You will need to override these two event. NTwain samples provide information on how to override.