Category / Section
How to read Intelligent Mail Barcode
1 min read
ZXing (zebra crossing) is an open-source tool to decode barcodes within images that fall under the Apache 2.0 license. It allows users to scan most of the 1D and 2D barcodes. Barcode OPX is used to optimize the working of ZXing. This enhanced library read the intelligent Mail Barcode (IBM) and returns the barcode value and type.
Steps to read Intelligent Mail Barcode (IMB) programmatically:
- Create a new C# Windows Forms application project.
- To use the Barcode Reader feature in applications, add the references to the following set of assemblies:
- Syncfusion.BarcodeReader.OPX
- zxing
- Include the following namespaces in Form1.cs file.
// [C# Code] using Syncfusion.BarcodeReader.OPX;
' [VB Code] Imports Syncfusion.BarcodeReader.OPX
- Use the following code snippet to read Intelligent Mail Barcode programmatically.
// [C# Code] string filePath = "IMBBarcode.png"; //Read barcode BarcodeResult result = BarcodeReader.ScanBarcode(filePath); if(result!=null) txtResult.Text += "Barcode Type: " + result.BarcodeType + " " + "Text: " + result.Text + "\r\n"; else MessageBox.Show("Barcode could not be detected", "Barcode Reader", MessageBoxButtons.OK);
' [VB Code] Dim filePath As String = "IMBBarcode.png" Dim result As BarcodeResult = BarcodeReader.ScanBarcode(filePath) If result IsNot Nothing Then txtResult.Text += "Barcode Type: " & result.BarcodeType & " " & "Text: " + result.Text & vbCrLf Else MessageBox.Show("Barcode could not be detected", "Barcode Reader", MessageBoxButtons.OK) End If
A complete working sample can be downloaded from BarcodeReaderSample.zip.
By executing the program, you will get the barcode type and values as follows.
Refer here to learn more about Barcode Reader OPX.