Search code examples
asp.netasp.net-mvctwaindotnetdynamic-web-twain

How to implement Scanning functionality using Twain in ASP.Net


I have to implement the scanning functionality in ASP.Net MVC.

After googling, I found that it is possible from TWAIN API which will support most of the drivers.

References:

1.Link 1

2.Link 2

Could anybody share some sample code for an ASP.Net MVC application, and what are the considerations we need to take care of while implementing this functionality?


Solution

  • Link 1 I've seen used in an application I inherited. Check the date of that article though, it was created before we had 64-bit Windows. I've seen an application that used that code fail as soon as it was moved onto a Windows version above XP since they are all 64-bit now and that references 32-bit. Still, it could be modified to work, but you're still attempting to wrap built-in OS functionality that isn't managed.

    The real question is, scanning from where? None of this code will be appropriate for a web-based application. If you could get Link 1 to work, it's only going to work for anyone who is sitting at that server, and frankly the security of the application wouldn't have access to the hardware without elevated privileges.

    Your best bet is going to look for a third-party component that comes with a browser-based component to do the client-scanning. I've used VintaSoft Twain in the past, but I believe it is limited to IE only. Dynamasoft has cross-browser solutions using HTML5 and ActiveX. LeadTools is another that has a cross-platform product, it's fairly pricey but LeadTools has an excellent reputation in document imaging and multimedia SDKs.