Barcode Scanner
Barcode scanner wrapper of QuaggaJS for Vaadin 14
Vaadin 14 Java integration of @granite-elements/granite-qrcode-scanner
After construct BarcodeScanner need to call initAndStart() method. (barcodeScanner.initAndStart())
Sample code
BarcodeScanner barcodeScanner = new BarcodeScanner(); Label lastScannedLabel = new Label("Last scanned value: unknown"); barcodeScanner.setConsumer(event ->{ System.out.println("data: " + event.toString()); lastScannedLabel.setText("Last scanned value: "+event.getCodeResult().getCode()); }); add(barcodeScanner); add(lastScannedLabel); barcodeScanner.setReaders(DecoderEnum.CODE_39_READER); barcodeScanner.setStopAfterScan(false); add(new Button("stop",e->{ barcodeScanner.stop(); })); add(new Button("start",e->{ barcodeScanner.initAndStart(); }));
BarcodeScanner barcodeScanner = new BarcodeScanner(event ->{ System.out.println("data: " + event.toString()); lastScannedLabel.setText("Last scanned value: "+event.getCodeResult().getCode()); }); Label lastScannedLabel = new Label("Last scanned value: unknown"); add(barcodeScanner); add(lastScannedLabel); barcodeScanner.setReaders(DecoderEnum.CODE_39_READER); barcodeScanner.setStopAfterScan(false); add(new Button("stop",e->{ barcodeScanner.stop(); })); add(new Button("start",e->{ barcodeScanner.initAndStart(); }));
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
fix test, add comments
- Released
- 2020-03-11
- Maturity
- EXPERIMENTAL
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 14+
- Browser
- N/A
Barcode Scanner - Vaadin Add-on Directory
Barcode scanner wrapper of QuaggaJS for Vaadin 14Vaadin 14 Java integration of @granite-elements/granite-qrcode-scanner
After construct BarcodeScanner need to call initAndStart() method.
(barcodeScanner.initAndStart())
![](https://raw.githubusercontent.com/MisoHampel/vaadin-14-barcode-scanner/master/demo.png)
View on GitHubBarcode Scanner version 1.0.1
fix test,
add comments