Barcode - width not enough generate rough result

5 posts, 0 answers
  1. Chris
    Chris avatar
    55 posts
    Member since:
    Oct 2015

    Posted 07 Jun Link to this post

    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

     

     

     

  2. Chris
    Chris avatar
    55 posts
    Member since:
    Oct 2015

    Posted 07 Jun in reply to Chris Link to this post

    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
        });

     

     

  3. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2083 posts

    Posted 09 Jun Link to this post

    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.
  4. Steve
    Steve avatar
    10 posts
    Member since:
    Nov 2012

    Posted 26 Jun in reply to Konstantin Dikov Link to this post

    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?

  5. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2083 posts

    Posted 28 Jun Link to this post

    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.
Back to Top