Text Ean-13 barcode error

I'm trying to print a label with an Ean-13 barcode. The barcode must have dimensions of about 27x10mm but by setting these dimensions the text is not resized correctly and is poorly formatted.

I also tried to hide the text by setting TextLocation to None but the text is not hidden but moved above the barcode.

The code I'm using is this:

            //Barcode
            PdfEan13Barcode ean13 = new PdfEan13Barcode();
            ean13.Size = new SizeF(MmToPoint(27), MmToPoint(10));
            ean13.Location = new PointF(MmToPoint(2), MmToPoint(20));
            ean13.Text = "8022983191959";
            ean13.TextDisplayLocation = TextLocation.None;
            ean13.Draw(page);

            ean13 = new PdfEan13Barcode();
            ean13.Size = new SizeF(MmToPoint(27), MmToPoint(10));
            ean13.Location = new PointF(MmToPoint(2), MmToPoint(35));
            ean13.Text = "8022983191959";
            ean13.TextDisplayLocation = TextLocation.Bottom;
            ean13.Draw(page);

Attached is the generated PDF.

     

Attachment: Barcode_Label_8e6ac133.zip

5 Replies 1 reply marked as answer

GK Gowthamraj Kumar Syncfusion Team April 8, 2021 01:50 PM UTC

Hi CSharpino, 
 
Thank you for contacting Syncfusion support. 
 
The barcode must have dimensions of about 27x10mm but by setting these dimensions the text is not resized correctly and is poorly formatted. 
We have tried the EAN 13 Barcode creation with provided code snippet on our end, but it resize properly. And the provided code has same size for both the barcodes. We have also checked with different size, its resize the barcode properly. Kindly provide more details such as complete code snippet or sample, product version to check the issue in our end. So, that it will be helpful for us to analyze and assist you further on this. 
 
However, can you please confirm whether you are reporting this as a format issue like below (text are rendered on the barcode), 
 
 
I also tried to hide the text by setting TextLocation to None but the text is not hidden but moved above the barcode. 
We were able to reproduce the text location hidden issue with provided details on our end. Currently, we are validating on this and we will update the further details on April 12th 2021.   
 
Regards, 
Gowthamraj K 



CS CSharpino April 9, 2021 07:31 AM UTC

Yes, the problem with resizing is that the text under the barcode is not formatted correctly.
The text should decrease its size proportionally to the size of the barcode or even better you should allow the user to change the font size.


GK Gowthamraj Kumar Syncfusion Team April 12, 2021 04:02 PM UTC

Hi CSharpino, 
 
Thank you for your patience. 
 
The barcode must have dimensions of about 27x10mm but by setting these dimensions the text is not resized correctly and is poorly formatted.  
I also tried to hide the text by setting TextLocation to None but the text is not hidden but moved above the barcode.  
We have confirmed that the issue “Text rendering issue while setting TextLocation as None to EAN Barcode type" is a defect. We will update the patch for this issue on April 19th, 2021. 
 
The status of this bug task can be tracked through the following feedback link: 
 
 
Regards, 
Gowthamraj K 



GK Gowthamraj Kumar Syncfusion Team April 19, 2021 03:13 PM UTC

Hi CSharpino, 
 
Sorry for the inconvenience caused. 
 
Due to the complexities with the reported issue, we are still working on this with high priority and we will update the patch for this issue on April 22, 2021. 
 
Regards, 
Gowthamraj K 



GK Gowthamraj Kumar Syncfusion Team April 22, 2021 04:40 PM UTC

Hi CSharpino, 
 
Thank you for your patience. 
 
We have fixed the issue with “Text rendering issue while setting TextLocation as None to EAN Barcode type”. The patch for this fix can be downloaded from the following location. 

The status of this bug can be tracked through the following feedback link,    
 
Recommended approach - exe will perform automatic configuration 
Please find the patch setup from below  
 
Advanced approach – use only if you have specific needs and can directly replace existing assemblies for your build environment 
Please find the patch assemblies alone from below  
 
 
Assembly Version: 19.1.0.54 

Installation Directions : 
This patch should replace the files “Syncfusion.Pdf.Base.dll” under the following folder. 
$system drive:\ Files\Syncfusion\Essential Studio\19.1.0.54 \precompiledassemblies\ 19.1.0.54 \4.5 
Eg : $system drive:\Program Files\Syncfusion\Essential Studio\ \precompiledassemblies\\4.5 

To automatically run the Assembly Manager, please check the Run assembly manager checkbox option while installing the patch. If this option is unchecked, the patch will replace the assemblies in precompiled assemblies’ folder only. Then, you will have to manually copy and paste them to the preferred location or you will have to run the Syncfusion Assembly Manager application (available from the Syncfusion Dashboard, installed as a shortcut in the Application menu) to re-install assemblies. 

Note : 
To change how you receive bug fixes, ask your license management portal admin to change your project’s patch delivery mode. 

Disclaimer : 
Please note that we have created this patch for version 19.1.0.54 specifically to resolve the following issue(s) reported in this/the forum 164295 

If you have received other patches for the same version for other products, please apply all patches in the order received. 
 
Regards, 
Gowthamraj K 


Marked as answer
Loader.
Up arrow icon