scannerjs
Version:
ScannerJS: JavaScript web scan JPG PDF images from TWAIN WIA scanners in browser (Chrome, Edge, Firefox or IE)
64 lines (52 loc) • 2.76 kB
HTML
<html lang="en">
<head>
<title>Scanner.js demo: low level scanner access API</title>
<meta charset='utf-8'>
<script src="https://asprise.azureedge.net/scannerjs/scanner.js" type="text/javascript"></script>
<script>
//
// Please read scanner.js developer's guide at: http://asprise.com/document-scan-upload-image-browser/ie-chrome-firefox-scanner-docs.html
//
function listSources() {
displayText("Listing sources ...");
scanner.listSources(callbackFunc, false, "all", true, true);
}
function selectSource() {
displayText("Select a source ...");
scanner.getSource(callbackFunc, "select", true);
}
function getSourceCaps() {
displayText("Gets source capabilities ...");
scanner.getSource(callbackFunc, "select", false, "all", false, true, "CAP_FEEDERENABLED: false; ICAP_UNITS: TWUN_INCHES");
}
function callbackFunc(successful, mesg, result) {
displayText((successful ? "OK" : "ERROR") + (mesg ? " - " + mesg : "") + "\n" + result);
}
function displayText(s) {
document.getElementById('output').textContent = s;
}
</script>
<style>
</style>
</head>
<body>
<h2>Scanner.js: Low level scanner access: list sources, select a source, get source capabilities</h2>
<input type="button" Value="List Sources" onclick="listSources();" />
<input type="button" Value="Select source" onclick="selectSource();" />
<input type="button" Value="Get source caps" onclick="getSourceCaps();" />
<pre id="output"></pre>
<!-- HELP_LINKS_START help links at the bottom -->
<style>
.asprise-footer, .asprise-footer a:visited { font-family: Arial, Helvetica, sans-serif; color: #999; font-size: 13px; }
.asprise-footer a { text-decoration: none; color: #999; }
.asprise-footer a:hover { padding-bottom: 2px; border-bottom: solid 1px #9cd; color: #06c; }
</style>
<div class="asprise-footer" style="margin-top: 48px;">
<a href="http://asprise.com/document-scan-upload-image-browser/direct-to-server-php-asp.net-overview.html" target="_blank" title="Opens in new tab">Scanner.js Homepage</a> |
<a href="http://asprise.com/scan/scannerjs/docs/html/scannerjs-javascript-guide.html" target="_blank" title="Opens in new tab">Developer's Guide to ScannerJs</a> |
<a href="https://github.com/Asprise/scannerjs.javascript-scanner-access-in-browsers-chrome-ie.scanner.js" target="_blank" title="Opens in new tab">Sample code on Github</a>
</div>
<!-- HELP_LINKS_END -->
</body>
</html>