We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Incorrect unreadable Barcode (PdfCode93Barcode)

Thread ID:

Created:

Updated:

Platform:

Replies:

145826 Jul 9,2019 08:57 PM UTC Jul 19,2019 11:11 AM UTC WinForms 10
loading
Tags: PDF
Viktor
Asked On July 9, 2019 08:57 PM UTC

Hi,
I've stumbled upon what seems to be a bug in PdfCodeBarcode.
i have tried PdfCode93Barcode, PdfCode93BarcodeExtended, PdfCode39Barcode but unfortunately without success.

the code is simple:

var document = new PdfDocument()
{
    PageSettings =
    {
        Size = new SizeF(252,102),
        Orientation = PdfPageOrientation.Landscape,
        Margins = new PdfMargins
        {
            Left = 2,
            Top = 0,
            Bottom = 0,
            Right = 1
        }
    }
};

var page = document.Pages.Add();

var font = new PdfStandardFont(PdfFontFamily.Helvetica, 8f, PdfFontStyle.Bold);
var code93 = new PdfCode93Barcode()
{
    TextDisplayLocation = TextLocation.None,
    Font = font,
    BarcodeToTextGapHeight = 1f,
    Text = "2101631034P1P1.1",
    Size = new SizeF(150, 30)
};
code93.Draw(page, new PointF(10, 10));

document.Save("2101631034P1P1.pdf");

Result (unreadable barcode):

Expected (readable barcode):


am i doing something wrong?
any idea how to fix the problem?
thanks in advance!
regards
viktor


Sowmiya Loganathan [Syncfusion]
Replied On July 10, 2019 01:00 PM UTC

  
Hi Viktor, 

Thank you for contacting Syncfusion support. 

We were able to reproduce the mentioned issue “Unreadable barcode generated with PdfCode93Barcode and PdfCode93BarcodeExtended”and suspect that this to be defect. Currently we are validating the same. We will update the further details by 12th July, 2019. But for Code39Barcode works fine in our end with the given input “2101631034P1P1.1”. Please let us know if you have any concerns on this.  

Regards,  
Sowmiya L 
 


Viktor
Replied On July 10, 2019 02:35 PM UTC

Hi Sowmiya,
thank you for the replay.
but i can not confirm, that given string "2101631034P1P1.1" works with Code39 .
i have attached the result to this message .
btw.
the Code93 doesnt work with a shorter string either, ie: 633551P1P1.1 .
but anyway.
we will be waiting for the hotfix.
thanks!
regards
viktor

Attachment: 2101631034P1P1_1_25da9ba8.zip

Sowmiya Loganathan [Syncfusion]
Replied On July 11, 2019 01:00 PM UTC

Hi Viktor, 

I can not confirm, that given string "2101631034P1P1.1" works with Code39 .  
I have attached the result to this message . 

We regret to let you know that the given text “2101631034P1P1.1” works fine with Code93 in our end. Please find the resultant PDF document from below link,  


Could you please share the product version which you have used in your end and region details. It will be helpful for us to provide the precise solution on this. 
the Code93 doesn’t work with a shorter string either, i.e.: 633551P1P1.1 . 
We were able to reproduce the issue. As promised earlier, we will update the validation details by 12th July, 2019.  

Regards, 
Sowmiya L 


Viktor
Replied On July 11, 2019 01:39 PM UTC

Hi Sowmiya,
the barcode you have provided doesnt work with the our laser scanners (Honeywell Eclipse and Socket Mobile CHS 8Ci)  either ! (:
but !
it works with the Scandit Mobile App.
interestingly!
what  type of barcode scanner did you use ?
i have attached the proj.
maybe it can help.
please let me know if you need some more info.
thanks!
regards
viktor


Attachment: SfPdfBarcode_846c890a.zip

Sowmiya Loganathan [Syncfusion]
Replied On July 12, 2019 12:20 PM UTC

Hi Viktor, 

We were able to reproduce the issue. As promised earlier, we will update the validation details by 12th July, 2019.   
We confirmed that the reported issue is a defect and logged a defect report. We will update the patch by 19th July, 2019.  
the barcode you have provided doesnt work with the our laser scanners (Honeywell Eclipse and Socket Mobile CHS 8Ci)  either ! (: 
but !
it works with the Scandit Mobile App. 
interestingly! 
what  type of barcode scanner did you use ? 

We have checked with the generated PDF document of Code 39 barcode using Zxing Barcode Reader and Mobile Barcode scanner App. As we said earlier it works fine Mobile Barcode Scanner. But it fails while decoding using  Zxing reader, the given barcode did not scanned. Currently we are analyzing about this and will update the details by 15th July, 2019. 


Regards, 
Sowmiya L 


Sowmiya Loganathan [Syncfusion]
Replied On July 15, 2019 09:30 AM UTC

Hi Viktor, 
 
We have checked with the generated PDF document of Code 39 barcode using Zxing Barcode Reader and Mobile Barcode scanner App. As we said earlier it works fine Mobile Barcode Scanner. But it fails while decoding using  Zxing reader, the given barcode did not scanned. Currently we are analyzing about this and will update the details by 15th July, 2019. 
As per the Code39 specification, we are generating the barcode properly and further analysis with the ZXing barcode reader failure, we found that the problem exists in the provided barcode size (Width=150, Height=30). We have export barcode as image from the PDF and scanned that the exported image using ZXing barcode reader, due to the minimum size, the exported is quality is not good, so that only it fails. After that we have increased the PDF page and Barcode size( PDF page size A4, Barcode size (450, 75)), it is scanned properly in the ZXing reader. So we suspect that the scanner may fails due to the barcode size for long input text. So kindly we suggest you increase the barcode size and ensure the same using your laser scanner and let us know whether it is working. 
  

Regards, 
Sowmiya L 


Viktor
Replied On July 15, 2019 10:31 AM UTC

Hi Sowmiya,
Unfortunately you solution would not work for us.
We use your component for label generation  (38mm X 89mm) so that your suggestion to increase the page size to A4 would not work.
anyway.
If I understand you correctly you are going to publish the patch for the Barcode93 by 19th July, 2019.
Correct?
We will waiting for the fix
Thanks
Viktor

Viktor
Replied On July 16, 2019 11:48 AM UTC

Hi
just to avoid misunderstandings.
all of the following strings generated with the PdfCode93Barcode  are incorrect:

634603P1P1.1
633246P1P1.1
633679P1P1.1
634005P1P1.1

you can use this in order to verify the tests for upcoming patch.
i can provide you some more strings if necessary.

the code:

var document = new PdfDocument()
{
    PageSettings =
    {
        Size = new SizeF(252,102),
        Orientation = PdfPageOrientation.Landscape,
        Margins = new PdfMargins { Left = 2,  Top = 0, Bottom = 0, Right = 1 }
    }
};
var page = document.Pages.Add();

var font = new PdfStandardFont(PdfFontFamily.Helvetica, 8f, PdfFontStyle.Bold);
var code93 = new PdfCode93Barcode()
{
    TextDisplayLocation = TextLocation.Bottom,
    Font = font,
    BarcodeToTextGapHeight = 1f,
    Text = "634005P1P1.1",
    Size = new SizeF(200, 43)
};
code93.Draw(page, new PointF(10, 10));
document.Save("634005P1P1_1.pdf");


let me know if you have any questions

regards
viktor
ps
our app is already in production and ~10% of the barcodes are unreadable (:


Sowmiya Loganathan [Syncfusion]
Replied On July 17, 2019 09:41 AM UTC

Hi Viktor, 
 
Unfortunately you solution would not work for us. 
We use your component for label generation  (38mm X 89mm) so that your suggestion to increase the page size to A4 would not work. 
On our further analysis, we found that the problem occurs due to the quality of the bars. If we draw the long text barcode to the smaller size page, this will be shrink based on the smaller size, and didn’t change any bars during this process. The bars are same, but the visual quality is poor. We have ensured this behaviour in some other barcode generator library and online barcode generators. So, we have created a workaround sample to achieve your requirement and attached the output document for the same. 
In this workaround sample the provided text scanned properly with the mentioned size. Also, we have an option to get the label width based on the barcode size by using barcode size property (it will not shrink the barcode, rendered with actual size).  
Please find the code snippet and sample for further details. 
var font = new PdfStandardFont(PdfFontFamily.Helvetica, 8f, PdfFontStyle.Bold); 
var code39 = new PdfCode39Barcode() 
{                 
    Font = font, 
    BarcodeToTextGapHeight = 1f, 
    Text = "2101631034P1P1.1", 
    BarHeight = 40,               
    NarrowBarWidth = 0.8f 
 
}; 
//Get the barcode size. 
var size = code39.Size; 
 
//Create PDF document based on the barcode size. 
var document = new PdfDocument() 
{ 
   PageSettings = 
   { 
       Size = new SizeF(size.Width + 22, size.Height + 12), //Added some space for left and top. 
       Orientation = PdfPageOrientation.Landscape, 
       Margins = new PdfMargins 
       { 
           Left = 2, 
           Top = 0, 
           Bottom = 0, 
           Right = 1 
       } 
   } 
}; 
var page = document.Pages.Add(); 
//Draw the barcode. 
code39.Draw(page, new PointF(10, 10)); 
document.Save("SF_2101631034P1P1.1.pdf"); 

Kindly try this sample and output document in your side and let us know whether this achieves your requirement. 
Output Documents :  
Sample:  
 
just to avoid misunderstandings. 
all of the following strings generated with the PdfCode93Barcode  are incorrect: 

634603P1P1.1 
633246P1P1.1 
633679P1P1.1 
634005P1P1.1 

you can use this in order to verify the tests for upcoming patch. 
I can provide you some more strings if necessary. 
We will ensure the values on the fix promised on 19th July 2019 and update you on the same. 
 
 
Regards, 
Sowmiya L 


Sowmiya Loganathan [Syncfusion]
Replied On July 19, 2019 11:11 AM UTC

Hi Victor,  
 
The issue with " Incorrect barcode generated while using PdfCode93Barcode" has been fixed and the patch for this fix can be downloaded from the following location.  
 
Recommended approach - exe will perform automatic configuration 
Please find the patch setup from below location: 
 
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 location: 
 
 
Assembly Version: 17.2.0.34 
Installation Directions :  
This patch should replace the files “Syncfusion.Pdf.Base.dll” under the following folder. 
$system drive:\ Files\Syncfusion\Essential Studio\$Version # \precompiledassemblies\$Version#\4.6 
Eg : $system drive:\Program Files\Syncfusion\Essential Studio\9.3.0.61\precompiledassemblies\9.3.0.61\4.0 
 
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 :  
You can change how you receive bug fixes by navigating to the following link and updating your preferences. 
 
 
Disclaimer :  
Please note that we have created this patch for version 17.2.0.34 specifically to resolve the following issue(s) reported in this/the Forum. 145826 
 
If you have received other patches for the same version for other products, please apply all patches in the order received. 
This fix will be included in our Volume 2 SP1  which will be available in August 2019. 
 
Regards, 
Sowmiya L 
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon