j-Scanner
The component for scanning documents.
- singleton
Methods:
component.show(opt)opt.points = [left+right {Number}, top+bottom {Number}]mask size defined in the percentageopt.callback = function(base64)The callback function, which will be executed when the user approves taken document. This callback function thakes an image in base64 format as a parameter
Use it with <ui-component name="scanner">. When the component is not loaded yet, jComponent downloads it on first use from the address in DEF.fallback (the Componentator CDN by default). Author: Kirill Zlobin. Source: the Componentator components repository, MIT license.
<ui-component name="scanner"></ui-component>
<button class="button">Open Scanner</button>
<script>
$(document).find('.button').on('click', function() {
var opt = {};
opt.size = '';
opt.points = [40, 30];
opt.callback = function(base64) {
console.log(base64);
}
SETTER('scanner/show', opt);
});
</script>