For Using BC.NetBarcodeReader.All1D in .NET
Scan, read, and recognize 1d barcodes Code 128, Code 39, EAN-13, EAN-8, UPC-A, UPC-E, and Interleaved 2 of 5 symbologies from images Jpg, Jpeg, Png, Tiff, Bmp, and Gif.
It's easy to use BC.NetBarcodeReader.All1D library to scan and decode 1d/linear barcode symbologies from images in your .NET applications. Here we will show you in simple steps. Please firstly download and get the free trial library (BC.NetBarcodeReaderTrial.All1D.dll). And the only thing for the integration of our library is to add your project reference to it.
We take the Console Application as an example of how to use BC.NetBarcodeReader.All1D library to read and recognize 1d barcodes from images. For ease of use, here are simple code examples for C# and VB.NET developers. To recognize all 1d and 2d barcodes, you should use BC.NetBarcodeReader.All library.
1. You can read and recognize a single 1D barcode type from an image using BC.NetBarcodeReader.All1D library.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BC.NetBarcodeReaderTrial.All1D;
namespace BC.NetBarcodeReaderDemo
{
class Program
{
static void Main(string[] args)
{
ReadOneBarcodeTypefromImage();
}
public static void ReadOneBarcodeTypefromImage()
{
string[] data = NetBarcodeReader.Recognize("Code39.jpeg", NetBarcodeReader.Code39);
/*string[] data1 = NetBarcodeReader.Recognize("F:/Code128.jpg", NetBarcodeReader.Code128);
string[] data2 = NetBarcodeReader.Recognize("F:/Ean13.gif", NetBarcodeReader.Ean13);
string[] data3 = NetBarcodeReader.Recognize("F:/Ean8.gif", NetBarcodeReader.Ean8);
string[] data4 = NetBarcodeReader.Recognize("F:/Interleaved25.bmp", NetBarcodeReader.Interleaved25);
string[] data5 = NetBarcodeReader.Recognize("F:/Upca.bmp", NetBarcodeReader.Upca);
string[] data6 = NetBarcodeReader.Recognize("F:/Upce.tif", NetBarcodeReader.Upce);*/
foreach (string result in data)
{
Console.WriteLine(result);
}
Console.ReadKey();
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports BC.NetBarcodeReaderTrial.All1D
Module BCNetBarcodeReaderDemo
Sub Main()
ReadOneBarcodeTypefromImage()
End Sub
Public Sub ReadOneBarcodeTypefromImage()
Dim data As String() = NetBarcodeReader.Recognize("Code39.jpeg", NetBarcodeReader.Code39)
'Dim data1 As String() = NetBarcodeReader.Recognize("F:/Code128.jpg", NetBarcodeReader.Code128)
'Dim data2 As String() = NetBarcodeReader.Recognize("F:/Ean13.gif", NetBarcodeReader.Ean13)
'Dim data3 As String() = NetBarcodeReader.Recognize("F:/Ean8.gif", NetBarcodeReader.Ean8)
'Dim data4 As String() = NetBarcodeReader.Recognize("F:/Interleaved25.bmp", NetBarcodeReader.Interleaved25)
'Dim data5 As String() = NetBarcodeReader.Recognize("F:/Upca.bmp", NetBarcodeReader.Upca)
'Dim data6 As String() = NetBarcodeReader.Recognize("F:/Upce.tif", NetBarcodeReader.Upce)
For Each result As String In data
Console.WriteLine(result)
Next
Console.ReadKey()
End Sub
End Module
2. You can read and recognize more than one 1D barcode types from image using BC.NetBarcodeReader.All1D library.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BC.NetBarcodeReaderTrial.All;
namespace BC.NetBarcodeReaderDemo
{
class Program
{
static void Main(string[] args)
{
ReadMultipleBarcodeTypesfromImage();
}
public static void ReadMultipleBarcodeTypesfromImage()
{
string[] data = NetBarcodeReader.Recognize("Multiple.png", NetBarcodeReader.Code39);
string[] data1 = NetBarcodeReader.Recognize("Multiple.png", NetBarcodeReader.Code128);
foreach (string result in data)
{
Console.WriteLine(result);
}
foreach (string result1 in data1)
{
Console.WriteLine(result1);
}
Console.ReadKey();
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports BC.NetBarcodeReaderTrial.All
Module BCNetBarcodeReaderDemo
Sub Main()
ReadMultipleBarcodeTypesfromImage()
End Sub
Public Sub ReadMultipleBarcodeTypesfromImage()
Dim data As String() = NetBarcodeReader.Recognize("Multiple.jpg", NetBarcodeReader.Code39)
Dim data1 As String() = NetBarcodeReader.Recognize("Multiple.jpg", NetBarcodeReader.Code128)
For Each result As String In data
Console.WriteLine(result)
Next
For Each result1 As String In data1
Console.WriteLine(result1)
Next
Console.ReadKey()
End Sub
End Module