Newer Version Available
DocumentScanner Example
Here’s an example of a Lightning web component that uses DocumentScanner to capture
text data from an image.
There’s an option to select the source of the image to be scanned, from either the device camera or the device image library.
This example uses DocumentScanner to choose a source for the document to be scanned, and to perform a basic scanning operation. After the scan completes, the results are displayed, along with an SVG graphic that annotates the scanned document graphic with an overlay of the result structured text data. A status message is returned when there’s an error.