cabrillo.camera - Client

  • リリースバージョン: Australia
  • 更新日 2026年03月12日
  • 所要時間:1分
  • Cabrillo JS camera functions to provide camera access for bar code scanning.

    cabrillo.camera - getBarcode()

    Provides a standard interface for scanning bar codes. Use this to present a bar code scanner and capture scanned result.

    Supported bar code types.
    • 1D bar codes: EAN-13, EAN-8, UPC-A, UPC-E, Code-39, Code-93, Code-128, ITF
    • 2D bar codes: QR Code, Data Matrix, PDF-417, AZTEC
    表 : 1. Parameters
    Name Type Description
    None
    表 : 2. Returns
    Type Description
    promise Resolves to a bar code string, or if the operation fails, an error.
    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);
    });