Skip to content

emirdeliz/barcode-reader-zbar-webassembly

Repository files navigation

Barcode Read - Ts and Webassembly

Build Lint Test

Barcode reader written in Ts and using webassembly. In addition, it calculates the check digit as well.

Run build.sh to build a docker and update the webassembly.

Demo

Upload Largest Files - example

https://emirdeliz.github.io/barcode-reader-zbar-webassembly/

How to use?

Added the static files (barcode-reader.js and barcode-reader.wasm) on the server. And then use the code below.

const result = BarcodeReader.readBarcodeFromStack({
  file,
});

or

const result = BarcodeReader.readBarcode({
  file,
});
About the methods:
Method Description
readBarcodeFromStack This method receives a ReadBarcodeProps and inserts the request on the stack of requests. This can be utils when you make multiple barcodes reads at the same.
readBarcode This method receives a ReadBarcodeProps and makes a simple read.
About the parameters ReadBarcodeProps:
Prop Type Description
file (optional) boolean The file related to pdf file.
scale (optional) boolean The scale or zoom applied on the pdf document before the search barcode.
sequenceNum (optional) Number The sequence number of the image when working with multiple barcodes.
password (optional) String The password to open the pdf file.