views:

1099

answers:

4

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?

A: 

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.

jarek
No need for a sig, that's what your profile is for, and linked to on every answer.
John Sheehan
+2  A: 

Check out this: http://code.msdn.microsoft.com/silverlightwia

Mitch Denny
A: 

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.

Si
A: 

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.

Spike0xff