Hello,
I’ve generated Barcode using ASPOSE and inserted into document file. Then I took print out of the same and faxed it as tiff and tried to read with BarcodeReader class(4.3.0 version). The reader is giving some ambiguous characters. With the newer versions of the dll I am just getting blank .
Below is my code if you want to look at.
var img = Image.FromFile(destFileName);
Guid guid = img.FrameDimensionsList[0];
FrameDimension dimension = new FrameDimension(guid);
int totalFrame = img.GetFrameCount(dimension);
var lic = new Aspose.BarCodeRecognition.License();
lic.SetLicense(“Aspose.BarCode.lic”);
//Feed the pages to BarCodeReader one by one
var rd = new BarCodeReader(new Bitmap(img));
for (int i = 0; i < totalFrame; i++)
{
img.SelectActiveFrame(dimension, i);
while (rd.Read())
{
barCodeText = rd.GetCodeText();
if (!string.IsNullOrEmpty(barCodeText))
{
MessageBox.Show(barCodeText);
// break;
}
}
}
rd.Close();
Can you please help me in this. I’ve used DataMatrix to generate the barcode.
Thanks in advance.
Hi,
Please find the attached test file that I am using.
Hi,
The original text was 1942843835092730.
The barcode was generated using Aspose.BarCode symbology type DataMatrix.
Hi,
Hello,
Thanks for your reply.
Below is the code.
Dim builder As New BarCodeBuilder
’ set the symbology type
builder.SymbologyType = Symbology.DataMatrix
’ Set the license file for Aspose.Barcode
Dim license As New Aspose.BarCode.License
license.SetLicense(“Aspose.BarCode.lic”)
Dim lic As New Aspose.BarCodeRecognition.License
lic.SetLicense(“Aspose.BarCode.lic”)
’ set the codetext
builder.CodeText = myTempVal
'Create A Memory Stream Object that Would store barcode image in binary form
Dim mStream As New System.IO.MemoryStream
builder.BarCodeImage.Save(mStream, System.Drawing.Imaging.ImageFormat.Png)
var img = builder.GenerateBarCodeImage();
img.Save(@“C:\BarCodeTest\MyTest.png”);
I Tried to save both as png and tif.
Hi,
Dim stream = New System.IO.MemoryStream()
Dim builder = New BarCodeBuilder()
builder.CodeText = “1942843835092730”
Console.WriteLine(“Encoded Text :” & builder.CodeText)
builder.SymbologyType = Symbology.DataMatrix
builder.Save(stream, ImageFormat.Png)
builder.BarCodeImage.Save(“C:\temp\image.png”, ImageFormat.Png)
Dim reader = New BarCodeReader(stream, BarCodeReadType.DataMatrix)
reader.Read()
Console.WriteLine(“Read from file saved as stream :” & reader.GetCodeText())
reader = New BarCodeReader(“C:\temp\image.png”, BarCodeReadType.DataMatrix)
reader.Read()
Console.WriteLine(“Read from file saved as image :” & reader.GetCodeText())