Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to scan a barcode image in a meteor application

Tags:

meteor

I'd like to put together a mobile-friendly data acquisition app This app would be used in a data center, which means working in a disconnected mode This app also needs to carry (on the client) a mongodb collection of ASCI| character codes, to be matched with the incoming barcodes Once being back online, this app should sync all acquired data with its back-end mongodb

Based on these requirements, I think, meteor would be a good choice

My questions is: are there meteor packages, that can scan an image, and then translate that image to an ASCII character code?

like image 579
Eugene Goldberg Avatar asked Jun 13 '15 23:06

Eugene Goldberg


People also ask

Can I read barcode as an image?

Aspose.Barcode Reader is a free online application to read barcodes from image or your mobile phone's camera. It supports 60+ barcode symbologies including all the popular ones. It is able to locate and read multiple barcodes on image. Our sophisticated algorithm allows you to read even damaged barcodes.

What language do scanners use?

The Scanner class is mainly used to get the user input, and it belongs to the java.


1 Answers

To get barcode scanning capability, use BarcodeScanner cordova plugin:

meteor add cordova:[email protected]

Template

<head>
  <title>Barcode Scanner</title>
</head>

<body
  {{> barcode_scanner}}
</body>

<template name="barcode_scanner">
  <button>Scan</button>
</template>

JS

if (Meteor.isCordova) {

  Template.barcode_scanner.events({
    'click button': function () {

      cordova.plugins.barcodeScanner.scan(
        function (result) {
          alert("We got a barcode\n" +
            "Result: " + result.text + "\n" +
            "Format: " + result.format + "\n" +
            "Cancelled: " + result.cancelled);
        }, 
        function (error) {
          alert("Scanning failed: " + error);
        }
     );

    }

  });

}

For offline data capability, take a look GroundDB

like image 112
Firdaus Ramlan Avatar answered Sep 28 '22 15:09

Firdaus Ramlan