Skip to main content
Home Forums Silverlight Programming Programming with JavaScript Silverlight and Scanning (Via TWAIN using Java Applet?)
4 replies. Latest Post by Kkou on November 18, 2009.
(0)
kd100
Member
0 points
2 Posts
11-05-2009 7:34 PM |
I am creating a Silverlight application that needs to communicate with a scanner (using TWAIN drivers). I know Silverlight cannot do this directly, and I will need to use Java to interact with the scanner. I don't want to use ActiveX because I need it to run on Macs and Linux machines.
So my question is, can I get a java applet to pass a scanned file to a Silverlight application? Is this done using web services? javascript? Can anyone confirm that this is is possible and maybe point me at some information regarding how it could be done?
purplechap
14 points
11-06-2009 10:46 AM |
The Silverlight app can use WebClient to download the file. This is asynchronous. System.Net.WebClient wc = new System.Net.WebClient(); wc.OpenReadCompleted += new System.Net.OpenReadCompletedEventHandler(wc_OpenReadCompleted); wc.OpenReadAsync(new Uri("http://localhost/filename.xxx")); void wc_OpenReadCompleted(object sender, System.Net.OpenReadCompletedEventArgs e) { // e.Result contains a Stream with the downloaded file. e.Result }
sl.ayer
Participant
848 points
162 Posts
11-10-2009 5:32 PM |
You might be able to pass data from Java applet to silverlight app using javascript as a bridge, but why go to such trouble? Why not just implement it all in Java?
11-10-2009 5:43 PM |
Basically because our company doesn't have any java programmers, just .NET developers. We were hoping to contract someone to do the scanning part in java. The scanning functionality is only a fraction of what our web application needs to do.
Anyway, I guess using javascript as a bridge sounds like an option. I guess we just have to expose a method in our Silverlight application as Scriptable.
Kkou
2 points
3 Posts
11-18-2009 9:40 AM |
I also have this kind of problem.
I have a task to develop a java application using the driver twain.
I want someone to help me.
How can I do this!
If someone see this, please send me a email at myskynim@yahoo.com.
Thankyou!