We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Custom size Code128 barcode doesn't work

Hi support team,


I’m trying to create Code128 barcode with custom size with the code below

using (var barCodeBuilder = new BarCodeBuilder(data, EncodeTypes.Code128))
{
var fileName = file + data + “.jpg”;
barCodeBuilder.CodeText = data;
barCodeBuilder.CodeLocation = CodeLocation.None;
barCodeBuilder.BorderWidth = 0f;
barCodeBuilder.RotationAngleF = 90;
barCodeBuilder.GraphicsUnit = GraphicsUnit.Pixel;

Bitmap bmp = barCodeBuilder.GetOnlyBarCodeImage();
Bitmap bitmap = barCodeBuilder.GetCustomSizeBarCodeImage(new Size(150, 139), false);
bitmap.Save(fileName);

return fileName;
}

However, after I generate the image, the barcode can’t not be recognized. It’s working for Pdf417 type tho.

Is anything I missed?

Cheers!
Zhen

Hi Zhen,


Thanks for your inquiry. I have tested the scenario using following code with Aspose.BarCode for .NET 16.12.1 and unable to notice any issue, barcode is being recognized successfully. Please share your complete sample code to recognize the barcode along with barcode text data, so we will further investigation the issue and will guide you accordingly.

using (var builder = new BarCodeBuilder(“Aspose123”, EncodeTypes.Code128))<o:p></o:p>

{

builder.CodeLocation = CodeLocation.None;

builder.BorderWidth = 0f;

builder.RotationAngleF = 90;

builder.GraphicsUnit = GraphicsUnit.Pixel;

Bitmap bmp = builder.GetOnlyBarCodeImage();

Bitmap bitmap = builder.GetCustomSizeBarCodeImage(new Size(150, 139), false);

bitmap.Save("E:/Data/Code128-customized_out.jpg");

BarCodeReader reader = new BarCodeReader("E:/Data/Code128-customized_out.jpg");

if (reader.Read())

{

string s = reader.GetCodeText();

Console.WriteLine("Text: {0}", s);

}

}


We are sorry for the inconvenience.

Best Regards,

Hi Tilal,


Thanks for the quick response. there is no issue to generate the barcode,but it’s not a valid barcode. if you try to upload barcode here https://online-barcode-reader.inliteresearch.com/. you can use any scanner to test the generated barcode. the link is the an example im using for testing.

Can you please advise what’s the issue?

Cheers!
Zhen

Hi Zhen,


Thanks for your feedback and sharing additional information. I have tested the resultant barcode with shared link of online barcode reader of inlite, it is working fine with it. However the barcode is not recognized by other online barocde reader tools, so logged a ticket BARCODENET-36451 in our issue tracking system for further investigation and rectification. We will keep you updated about the issue resolution progress.

We are sorry for the inconvenience.

Best Regards,

Hi Tilal,


I downloaded your image, and tested again on the online-barcode-reader. It’s not always working. I uploaded 3 times with the same image, 2 times failed.

It shows the following message:

No barcodes found on this page for the following selected barcode types:

1D Barcodes

Do you know what’s the estimate for fixing the issue? As our website is going live soon. Can you please escalate this issue?

Cheers!
Zhen

Hi Zhen,


We are sorry for the inconvenience. I have again tested number of times above shared image with online-barcode-reader but I am afraid it did not fail once.

Furthermore, I am afraid we can not share any ETA at the moment as we have recently logged the issue and it is pending for investigation. Once issue investigation is completed then we will be in good position to share an ETA/update with you. We will notify you as soon as we made some significant progress towards issue resolution.

Thanks for your patience and cooperation.

Best Regards,