4

Here's the problem: I have a usb scanner (HP) and want to get the image through a web application. Solved long ago with a java applet but now chrome doesn't support them anymore.

I've already seen potential solutions. The "coolest" one was Dynamsoft but I can't afford on NPAPI or ActiveX. I've seen html5 websocket technology, the communication works but it seems that there are no way to interface it with the scanner.

Sebas
  • 21,192
  • 9
  • 55
  • 109
Federico Luca
  • 43
  • 1
  • 4
  • This is Rachel from Dynamsoft. Along with ActiveX and NPAPI editions, Dynamic Web TWAIN also comes with HTML5 edition to support the latest versions of Chrome and Firefox on Windows and Mac OS X. Besides the price on our website, we also provide some more flexible licensing options which might suit your needs. Please contact sales[@]dynamsoft.com for more details. – Rachel Aug 28 '15 at 09:05

2 Answers2

5

I'm in a similar boat. Firefox has announced deprecation as well but has not yet set a date for end of support. Your only other option in the near future is to write your own plugin based on PNACL. I've made attempts at this and found it difficult due to PNACL limiting C source's functionality. If using Dynamsoft's products you'll want to use their Web TWAIN SDK which would cover most users, but again their price can be an issue.

In the future we might have some things to look forward to:

  • chrome.documentScan - only for Chrome OS, let's hope they port it back to Windows!
  • WebUSB - drivers in Javascript, not my cup o' tea
  • TWAIN Direct - driverless scanning, will not work with older scanners
MaKR
  • 1,882
  • 2
  • 17
  • 29
  • Thanks MaKR. I've to say that I didn't know about WebUSB. Actually I don't trust it too, and I don't think it will survive. Twain direct seems interesting but the missing backward compatibility could be a problem. Hope they do port documentScan then! :D – Federico Luca Aug 31 '15 at 08:18
  • Since I posted this answer I am no longer with the company I had been developing web scanning for. It took the other 2 developers there less than a day to add DynamSoft WebTWAIN, so based on that I can say I would highly recommend it. It's complete, well documented, and you'll save a ton of time. – MaKR Sep 09 '15 at 01:11
1

I've got some workaround idea. It's not using NPAPI plugin so it will be compatible with modern browsers.

User must download and run installer. This installer contains some scanner software (compatible with most scanners) with support for command line and software to uploading files by FTP I use NASP2 (support most modern scanners) to scan and WINSCP to upload by ftp (we need only winscp.exe amd winscp.com files). I put WINSCP files to NASP2 folder.

Our installer create bat file ScanToMyWebsite.bat in NASP2 folder, something like:

@echo off
echo Scanning, please wait...
"C:\Program Files\NAPS2\NAPS2.Console"  -f  -o "%appdata%/NAPS2/temp/my_scan.pdf"
echo Uploading scan...
winscp.com /command "open ftp://login:password@our_ftp_server.pl" "put  ""%appdata%\NAPS2\temp\my_scan.pdf""" "exit"
echo Done!

This bat file just scan document and upload it to ftp server.

Then our installer register new protocol in system - for example "scan-to-my-website:" (it's like http:, ftp: etc.) by exec .reg file (our installer do this):

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\scan-to-my-website]
@="URL:scan-to-my-website Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\scan-to-my-website\DefaultIcon]
@="C:\\Program Files (x86)\\NAPS2\\NAPS2.exe"

[HKEY_CLASSES_ROOT\scan-to-my-website\Shell]

[HKEY_CLASSES_ROOT\scan-to-my-website\Shell\Open]

[HKEY_CLASSES_ROOT\scan-to-my-website\Shell\Open\command]
@="\"C:\\Program Files\\NAPS2\\ScanToMyWebsite.cmd\""

Now we can create in our website

<a href="scan-to-my-website:">Scan!</a>

After click on this link it just run bat file which we created and upload scan to ftp server. By AJAX or any other method website can check is file has been uploaded. That's it :)

Pacjonek
  • 152
  • 2
  • 9