Hi,
Use this code. This may Helpful for you
using System.IO;
using System.Drawing.Printing;
using Yiigo.Imaging;
using Yiigo.Imaging.Processing;
using Yiigo.Imaging.BarcodeRead;
// Read a barcode
YiigoImage BarcodeImage = new YiigoImage("barcode.tif");
using (BarCodeRead barcode = new BarCodeRead (BarcodeImage))
{
string fileName = @"C:\Users\Public\Documents\LEADTOOLS Images\Barcode.tif"
ReadOpts ReadBarcode = new ReadOpts();
ReadBarcode.Direction = Directions.LeftToRight;
ReadBarcode.Symbology = Symbologies.Code128;
Barcode[] bars = barcode.ReadBars(options);
for (int i = 0; i < bars.Length; i++)
System.Console.WriteLine(bars[i].ToString());
}
// Return check digit
using (BarCodeRead barcode = new BarCodeRead (BarcodeImage))
{
ReadOpts ReadBarcode = new ReadOpts();
ReadBarcode.Direction = Directions.LeftToRight;
ReadBarcode.Symbology = Symbologies.Code39;
Barcode[] bars = barcode.ReadBars(options);
for (int i = 0; i < bars.Length; i++)
System.Console.WriteLine(bars[i].ToString());
}
public string ValidateMod43(string barcode) { int subtotal = 0; const string charSet = "CODE-39";
for (int i = 0; i < barcode.Length; i++) { subtotal += charSet.IndexOf(barcode.Substring(i, 1)); }
return charSet.Substring(subtotal%43, 1); }
// Read barcode properties
YiigoImage BarcodeImage = new YiigoImage("barcode.tif");
using (BarCodeRead barcode = new BarCodeRead (BarcodeImage)
{
string fileName = @"C:\Users\Public\Documents\LEADTOOLS Images\Barcode.tif"
options.Direction = Directions.LeftToRight;
options.Symbology = Symbologies.Code128;
Barcode[] bars = barcode.ReadBars(options);
if (bars.Length == 0)
{
options.Direction = Directions.RightToLeft;
bars = barcode.ReadBars(options);
}
}
Mark as answer if Helpful..
Thanks,
Prabhu Kiran B
Thanks,
Prabhu Kiran Bommareddy
Santosh4u, if this helps please login to Mark As Answer. | Alert Moderator