This is a migrated thread and some comments may be shown as answers.

Barcode - width not enough generate rough result

4 Answers 261 Views
Barcode
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Veteran
Iron
Iron
Chris asked on 07 Jun 2017, 06:10 AM

HI

I have test the Kendo UI Barcode and have found some problems.

。The Barcode result will become rough while width does not enougth (even if renderAs: "canvas" or "svg").
(see Image1 - rough result)

。Larger width will cause error (even if height is greater then the suggested value) : 

    $(container).find("#gudbrands").kendoBarcode({
      value: "1234567890" ,
      type: "code39",
      width: 580,
      height: 100
    });

Uncaught Error: Insufficient Height. The minimum height for value: 1234567890 is: 87

    at o.prepareValues (kendo.all.min.js:97)
    
       at o.addData (kendo.all.min.js:97)
    
       at o.encode (kendo.all.min.js:97)
    
       at init._render (kendo.all.min.js:97)
    
       at init.createVisual (kendo.all.min.js:97)
    
       at init.redraw (kendo.all.min.js:97)
    
       at init.setOptions (kendo.all.min.js:97)
    
       at new init (kendo.all.min.js:97)
    
       at HTMLDivElement.<anonymous> (kendo.all.min.js:26)
    
       at Function.each (jquery-2.2.4.min.js:2)

My questions : 
1.Could Barcode could auto size by itself ? 
2.The height of the Barcode should not be limited(see Image2 - long code39)

Best regards

Chris

 

 

 

4 Answers, 1 is accepted

Sort by
0
Chris
Top achievements
Rank 1
Veteran
Iron
Iron
answered on 07 Jun 2017, 06:46 AM

And Why the result of  type: "canvas" is rough then type: "svg" with the same code ?

    $("#barcode").kendoBarcode(
    {
      type: "code39",
      value: "1234567890",
      checksum: true,
      height: 100,
      width: 360
    });

 

 

0
Konstantin Dikov
Telerik team
answered on 09 Jun 2017, 06:32 AM
Hello Chris,

The recommended height in the error specified the minimum height for the barcode, but without the text. The height in the configuration of the Barcode will include the text, so you need to ensure that remaining height will be enough for the minimum required height. 

As for the difference between the "canvas" and the "svg", could you please give an example that difference?


Regards,
Konstantin Dikov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Steve
Top achievements
Rank 1
answered on 26 Jun 2017, 02:26 PM

I posted in the MVC forums just days prior to Chris with a similar issue that did relate to insufficient height.

http://www.telerik.com/forums/how-to-resize-barcode-in-script

Konstantin, my question to you based upon your reply is:

How do you know the minimum height that it must be set to prior to getting the error?  Is there some sort of aspect ratio that we can use?

0
Konstantin Dikov
Telerik team
answered on 28 Jun 2017, 09:31 AM
Hello Steve,

With the default font-size you could use the following for determining the minimum height:
On a side note, I will log this for improvement, because the error message should show a correct minimum height.


Regards,
Konstantin Dikov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Barcode
Asked by
Chris
Top achievements
Rank 1
Veteran
Iron
Iron
Answers by
Chris
Top achievements
Rank 1
Veteran
Iron
Iron
Konstantin Dikov
Telerik team
Steve
Top achievements
Rank 1
Share this question
or