# j-Scanner

> The component for scanning documents.

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: en
Content-SHA256: 4a6e0f0ae3e4fc351bbd0942c3e8c9629b2d68014bb56c3a7c8251d96ecc82e9
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

The component for scanning documents.

- singleton

__Methods__:

- `component.show(opt)`
	- `opt.points = [left+right {Number}, top+bottom {Number}]` mask size defined in the percentage
	- `opt.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.

```html example.html
<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>
```
