I am trying to upgrade Aspose.BarCode dll from version 2.1.0.38800 to 3.6.0.0
In v2.1, I was using Apose.BarCode.BarCodeReader to detect a barcode in the Bitmap but in version 3.6, I couldnt find that class in Apose.BarCode namespace
v2.1:
Aspose.BarCode.BarCodeReader reader = new Aspose.BarCode.BarCodeReader();
v 3.6:
(Solution ?)
Thanks,
Uday
Hi Uday,
- Add reference to the new dll for recognition. Aspose.BarCodeRecognition.dll
- New namespace. Aspose.BarCodeRecognition
- Symbology type can be set in constructor of BarCodeReader class (BarCodeReader.BarCodeReadType is no longer available)
- BarCodeReader.Read() method now returns boolean value. Returns true, if barcode found, otherwise false. BarCodeInfo class is no longer available.
- New method for getting symbology information for recognized barcode (BarCodeReader.GetReadType()). BarCodeInfo.BarCodeReadType property is no longer available.
- New method for getting codetext of recognized barcode (BarCodeReader.GetCodeText()). BarCodeInfo.CodeText property is no longer available.
Thanks Razzaq for the answer but problem with my project is I am unable to file the namespace Asponse.BarCodeReader and Aspose.BarCodeRecognition.
Clipboard01.jpg shows the object browser for the DLL
I also attached project which may be helpful for your review.
Am I missing any DLL other than Aspose.BarCode.dll which I have to add?
Hi,
- Aspose.BarCode.dll - You already added reference. Contains BarCodeBuilder class
- Aspose.BarCodeRecognition.dll - Please add reference to this in your project. Contains BarCodeReader class
- Aspose.BarCode.WPF.dll - Contains barcode generation functions for use with WPF applications
Thanks for the help Razzaq.
Hello Razzaq,
Document ‘faxTest Doc.jpg’ contains a barcode which I am able to detect using old version dll but I dont get any results while using new version dll.
private void OldBarCode(Bitmap page)
{
// set license for barcode generation
Aspose.BarCode.License licGen = new Aspose.BarCode.License();
licGen.SetLicense(@“Aspose.BarCode.lic”);
// initialize the reader
using (BarCodeReader reader = new BarCodeReader(page))
{
//clear symbology
reader.SymbologyType = (Symbology)(0);
reader.SymbologyType |= Symbology.Code39Standard;
reader.SymbologyType |= Symbology.Pdf417;
reader.SymbologyType |= Symbology.Code128;
reader.SymbologyType |= Symbology.DataMatrix;
BarCodeInfo[] infos = reader.Read();
if (infos.Length > 0)
{
for (int index = 0; index < infos.Length; index++)
{
Response.Write("Codetext: " + infos[index].CodeText + “
”);
break;
}
}
}
}
private void NewBarCode(Bitmap page)
{
// set license for barcode generation
Aspose.BarCode.License licGen = new Aspose.BarCode.License();
licGen.SetLicense(@“Aspose.Total.lic”);
// set license for barcode recognition
Aspose.BarCodeRecognition.License licRec = new Aspose.BarCodeRecognition.License();
licRec.SetLicense(@“Aspose.Total.lic”);
// initialize the reader
using (BarCodeReader reader = new BarCodeReader(page, BarCodeReadType.Code39Standard))
{
while (reader.Read())
{
// display the codetext
Response.Write("Codetext: " + reader.GetCodeText());
}
}
}
Can you spot any difference between NewBarCode and OldBarCode methods?
Do I add anything to detect the barcode?
Let me know if you need anything else.
Thanks,
Uday
I think I missed BarCodeReadType.Pdf417 in reader construct.
Thanks,
Hi there… I have an old license of your software, the latest version of Aspose.Barcode I can use is v3.0. I had been using the BarcodeReader class, but with this new upgrade (from v2.7 to v3.0) this class is gone. I’ve seen in documentation that starting with v3.0, there is now a BarcodeRecognition namespace, however I can’t find it. In my installation there was no Aspose.BarcodeRecognition.dll, only Aspose.Barcode. How do I install or find this library?
Hi,
Thank you for inquiry.
Please check the installation folder (default: C:\Program Files (x86)\Aspose\Aspose.BarCode\bin). You will find “Aspose.BarCodeRecognition.dll” in the respective sub-folder.
You also need to add a new references to this dll in your Visual Studio project.
Saqib,
Hello Matt,
Sorry, the attached MSI do not have the BarCodeRecognition.dll. Please find the dll files of 3.0 attached.
It is version 3.0, which is very old. If possible, please use the latest v4.2 with improvements and fixes.
Edit: Added the attachment.
Perfect, thank you so much Saqib!!