2

I implemented Scanner application using Twain jar to acquire the image. now it is working fine with chrome browser but i have seen that after chrome 45 version the plugin would not support with java. is there any alternative way to solve this problem so that it would work with chrome browser. i am using 32 bit java windows OS and twain 2.x version jar.

Sthogari
  • 45
  • 2
  • 14

3 Answers3

2

As newer builds of Google Chrome don't support NPAPI (Netscape plugin interface used by Firefox) and there's no Pepper (new plugin interface for Google Chrome) plugin for Java your only option is probably to implement the scanning portion of your application as a standalone program that will scan the image and pass it to the web application e.g. using WebSocket or local HTTP server embedded into it. Drawback is that user will need to install and run that application before he/she can scan anything.

If you target browsers on Windows I believe there are some efforts to bring driver-less scanning on TWAIN scanners to HTML5 browsers. It's called WebTWAIN and you can find more information here: http://www.dynamsoft.com/Products/WebTWAIN_Features.aspx#Scan

blami
  • 6,588
  • 2
  • 23
  • 31
  • thanks for your reply. i want to develop the application which is allow the user to scan the image from browser. so i can't use standalone application.and i want to use open source API. – Sthogari Jun 04 '15 at 10:01
0

See Chrome's NPAPI deprecation documentation for info on enabling NPAPI (and therefore Java), as well as a roadmap for deprecation (which means this is only a temporary fix). Visit chrome://flags/ and search using ctrl+F for NPAPI and enable the functionality.

In September 2015 (Chrome 45) we will remove the override and NPAPI support will be permanently removed from Chrome. Installed extensions that require NPAPI plugins will no longer be able to load those plugins.

Since this is a new app I'd avoid Java like the plague. It's only a matter of time before other browsers follow suit, and anything that you get working in Chrome goes away permanently in September. As per blami's answer you can use the Dynamsoft library, which has already taken steps to make this functionality work. Their library is quite expensive, so as a long-term solution our company is looking into using chrome.usb or porting an open-source C-based library to a newer Chrome plugin/extension library. Unfortunately other than Dynamsoft's library there are no currently working packaged solutions.

MaKR
  • 1,882
  • 2
  • 17
  • 29
0

You can create a Web server with Jetty. Jetty provides a Web server and javax.servlet container, plus support forSPDY, WebSocket, OSGi, JMX, JNDI, JAASand many other integrations. Integrate your Java TWAIN module to Jetty and send captured images to your Web client.

For example:

enter image description here

Here is the relevant article - Document Web Scanning in HTML5 and Java

yushulx
  • 11,695
  • 8
  • 37
  • 64