Barcode
The Barcode extension component uses ZXing.Net to generate Barcodes on the server and render them on the client. Supports: UPC-A, EAN-8, EAN-13, Code 39, Code 128, ITF, Codabar, Plessey, MSI, QR Code, PDF-417, Aztec, Data Matrix.
Features
Generate Barcodes
Read Barcodes using the device's camera.
How to Use
The Barcode extension can be added to a Wisej.NET project using NuGet Package Manager.
Barcode
This class can be used to display values as Barcodes. Use the Text property to set the value and the BarcodeType property to select the type of Barcode. The BarcodeType determines the list of allowed values/formats. Use the ShowLabel property to optionally show the value as a label text (if supported by the BarcodeType).
BarcodeReader
The Wisej.Web.Ext.Barcode extension also includes the ability to read and parse barcodes using a given System.Drawing.Image or by attaching to a Wisej.Web.Ext.Camera instance to detect barcodes in real-time on the client.
Using an Image
Using the BarcodeReader to parse images on the server is easy. It utilizes ZXing.Net to parse the data from the image.
The following code snippet shows how to parse the barcode data and display it in an AlertBox.
Using a Camera Instance
When attaching to a Camera instance, the processing of images takes place on the client using zxing-js.
Three scan modes are available:
Automatic: Continuously scans the environment for barcodes.
AutomaticOnce: Stops scanning after one successful barcode detection.
Manual: Requires the user to call the ScanImage method.
You must attach a handler for ScanError and ScanSuccess to receive the scanning data from the client widget.
The following example shows how to attach and continuously scan images from the camera instance.
Last updated