cabrillo.camera – Client
Cabrillo JS Kamerafunktionen zum Zugriff auf die Kamera für das Scannen von Barcodes.
cabrillo.camera – getBarcode()
Bietet eine Standardschnittstelle zum Scannen von Barcodes. Verwenden Sie diese Option, um einen Barcode-Scanner anzuzeigen und das gescannte Ergebnis zu erfassen.
Unterstützte Barcodetypen.
- 1D-Barcodes: EAN-13, EAN-8, UPC-A, UPC-E, Code-39, Code-93, Code-128, ITF
- 2D-Barcodes: QR-Code, DataMatrix, PDF-417, AZTEC
| Name | Typ | Beschreibung |
|---|---|---|
| Keine |
| Typ | Beschreibung |
|---|---|
| promise | Löst sich zu einer Barcode-Zeichenfolge auf, oder, wenn die Operation fehlschlägt, zu einem Fehler. |
cabrillo.camera.getBarcode().then(function(barcode) {
if (barcode) {
console.log('Scanned barcode.', barcode);
} else {
console.log('User cancelled scanning barcode.');
}
}, function(error) {
console.log('Failed to scan barcode.', error);
});