QR Code Size

4 posts, 0 answers
  1. Richard
    Richard avatar
    9 posts
    Member since:
    May 2013

    Posted 18 Jul 2013 Link to this post

    Dear All,

    I have the following code to print QR Code dynamically:
         TableRow rw = new TableRow();

                RadBarcode barcode1 = new RadBarcode();
                barcode1.Type = BarcodeType.QRCode;
                barcode1.Attributes.Add("Width","50px");
                barcode1.Attributes.Add("Height", "50px");
         
                barcode1.ShowText = true;
                barcode1.Text = "ABCDE";
               
                TableCell cell = new TableCell();
                cell.Controls.Add(barcode1);
                cell.Attributes.Add("Width","150px");
                cell.RowSpan = 8;
                rw.Cells.Add(cell);

    I have specify the width and height at 50px. however, the actual output always at 159px no matter what size i specify.

    The following is the output:
    <tr><td Width="120px" rowspan="8"><span id="ctl02" class="RadBarcode" Width="100px" Height="100px" style="display:inline-block;height:150px;width:300px;"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="159px" height="159px" viewBox="0 0 106 106" >

    can any one tell me how to change the svg width and height attributes? or any other work around?

    greatly appreciate for any helps.

    regards,
    Richard

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 19 Jul 2013 Link to this post

    Hi Richard,

    Try setting the DotSize property to specify the size of the barcode dots in pixels. This can help you to achieve sharp rendered QR Code and it can be used in combination with Width="" and Higth="" and the QR will be sized according to the number of its dots. If you set DotSize to zero, the QR symbol will be resized to fill up the Width and Height.

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 19 Jul 2013 Link to this post

    Hi Richard,

    If you set DotSize=0, the QR symbol will be resized to fill up the Width and Height.

    Regards,
    Vasil
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  5. Richard
    Richard avatar
    9 posts
    Member since:
    May 2013

    Posted 21 Jul 2013 Link to this post

    thanks all for your reply.

    yes, it's working now :)
Back to Top