WIA through web browser - ASP.NET

2019-01-28 16:43发布

I am wondering what would be the best/preferred way to write a scanning app that lives in a web browser. The basic idea is I want to use a web page from where I can click a button which will scan a document on the client and upload that document to server. The first thought that came to mind is write a native (C++?) browser plug-in. However, I don't know what is required for a native plug-in to be cross-browsers. So here are few questions:

  1. Is Silverlight a viable option? This is what I would prefer since all my code is C#, ASP.NET. The question is - can Silverlight talk to Windows Image Acquisition COM on the client?

  2. Write something in flash, may be using Flex? Is this a viable option? Can it talk to WIA COM on the client?

  3. And finally, if the answer is writing it in C++ then what are some of the high-level gotchas to make it cross-browser?

  4. What else is out there?

4条回答
混吃等死
2楼-- · 2019-01-28 17:04

Have a look at XBAP. It's a WPF Web Based Application. It requires .NET 3.5 on the client so is windows only, but runs in the browser.

Our product has just started using it, and I've just been investigating incorporating it into our CI and release process. Bit of a learning curve but we are pretty close to automated deployment (without publishing), I'll update that question once we're happy with our approach.

查看更多
一夜七次
3楼-- · 2019-01-28 17:05

Silverlight runs in a sandbox and cannot access any resources on a local machine (except isolated storage). It cannot access COM objects, It cannot access local hardware.

The option you may consider is to install little service on a client machine that will communicate with WIA and have SL talk with this service using ports.

查看更多
冷血范
4楼-- · 2019-01-28 17:13

Another solution could be a (signed) Java package, which can get to TWAIN using a small native-code DLL included in the package. The Gnome folks have a product called Morena Framework that works this way. It is also possible to roll your own solution in this style. I would not base any serious document scanning solution on WIA, unless things have greatly improved with WIA 2.0 - at minimum, do some realistic tests with scanners like the Fujitsu fi's, Canon DR's, Kodak i-series, Visioneer or Documate ADF units, and the HP N6010 or 5K.

查看更多
Anthone
5楼-- · 2019-01-28 17:14
登录 后发表回答