How Can I Trigger A Scanner From A Browser?
Solution 1:
This isn't possible from directly within a standard HTML/js page - js has no permissions to access peripherals like scanners.
It may well be possible using either flash or silverlight but suspect you'd hit permissions issues. There's articles here and here but it may be a) too involved and b) not quite what you're after.
If you control the machines the web app will be running on, I'd recommend using a simple desktop client to perform the scan and allowing connections to it from within the webpage by opening up a local port
so js does an AJAX call to (say) http://localhost:1234/Services/Scan which returns an image
Edit: With regards to writing the desktop client, you've got a number of options. I'd personally recommend you not try to do this in PERL/PHP as they don't seem to be the right tool for the job and I suspect you'll end up loading COM objects to try and access TWAIN devices (and we all know how much fun that is...)
In the comments, you've indicated you don't like Visual Studio - So if you're familiar with Java, I'd suggest you have a look at JTwain (commercial but seems to be good quality) or start reading here. NB: I'm not a frequent java developer so can't guarantee either of the above is exactly what you need.
Beyond that, I'd suggest C++ using a different IDE (although this wouldn't be OS-agnostic)
Solution 2:
There is a solution called Dynamic Web TWAIN from Dynamsoft which provides a Browser-based TWAIN SDK for acquiring images from TWAIN devices, and editing and saving them to remote databases.
Solution 3:
As @Basic mentioned, JTwain can be used to create such a solution. In fact, the developer of JTwain has created ScannerJS that allows one to scan directly from browsers like IE, Chrome and Firefox using JavaScript. In order to use it in your web pages, you need:
Include scanner.js:
<htmllang="en"><head><scriptsrc="//asprise.azureedge.net/scannerjs/scanner.js"type="text/javascript"></script>
and call scanner.scan
:
functionscanToWebPageAndUploadToWebServer() {
scanner.scan(displayImagesOnPage,
{
"twain_cap_setting": {
"ICAP_PIXELTYPE": "TWPT_GRAY",
"ICAP_XRESOLUTION": "200",
"ICAP_YRESOLUTION": "200"
},
"prompt_scan_more": true,
"discard_blank_pages": "false",
"blank_page_threshold": "0.02",
"output_settings": [
{
"type": "return-base64-thumbnail",
"format": "jpg",
"thumbnail_height": 200
},
{
"type": "upload",
"format": "pdf",
"pdf_force_black_white": "false",
"pdfa_compliant": "false",
"pdf_text_line": "By ${USERNAME} on ${DATETIME}",
"exif": {
"DocumentName": "Doc Scan Powered by Asprise.com",
"UserComment": "Scanned using Asprise software"
},
"upload_target": {
"url": "https://asprise.com/scan/applet/upload.php?action=dump",
"max_retries": 2,
"post_fields": {
"provider": "Asprise"
},
"cookies": "name=Asprise; domain=asprise.com",
"auth": "user:pass",
"headers": [
"Referer: http://asprise.com"
],
"log_file": "null",
"max_operation_time": 600
}
}
]
}
);
}
Solution 4:
You can use a signed applet, using a library like MMS computing's. You can see it in use in an applet in the codebase of OpenKM.
Solution 5:
It seems there's a Web API toolkit available for Fujitsu fi series scanners. Its basically an app you install on client machine where the scanner is that accepts calls via JSON or Silverlight and sends them to the scanner drivers.
http://uk.emc.com/enterprise-content-management/captiva/cloud-toolkit.htm
I've just downloaded it and am reading trough the docs, so can't vouch it works.
Post a Comment for "How Can I Trigger A Scanner From A Browser?"