Java Applet and dll

Fabrizio D'Ammassa :

I'm writing a web application that allows users to upload documents importing them directly from devices (i.e. scanners).

I would like to realize a simple web app that uses a Java Applet to handle device communication. I have created the jtwain.dll following this tutorial : http://today.java.net/pub/a/today/2004/11/18/twain.html and a demo app works fine in standalone mode.

Now I need to switch to applet but I don't know how to distribute the jtwain.dll to the client in order to make the applet work fine (this app will be used in an intranet where the clients are Windows XP or later).

Mike K. :

I did this a long time ago, but the gist of it is that you want to extract the DLL out of your applet's code base so you'll store it in the JAR, and then you want to copy it into the /lib/ext folder of the JRE.

 //Where this is an applet
 URL codeBase= this.getCodeBase();
 URL twainUrl new URL(codeBase, "jtwain.dll");
 String javaHome=System.getProperty("java.home");
 //copy the contents of twainUrl to javaHome\lib\ext

You'll need your applet to be signed.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related