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

QR Code Size

3 Answers 71 Views
Barcode
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 19 Jul 2013, 03:42 AM
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

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 19 Jul 2013, 05:22 AM
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.
0
Vasil
Telerik team
answered on 19 Jul 2013, 01:32 PM
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.
0
Richard
Top achievements
Rank 1
answered on 22 Jul 2013, 02:04 AM
thanks all for your reply.

yes, it's working now :)
Tags
Barcode
Asked by
Richard
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Vasil
Telerik team
Richard
Top achievements
Rank 1
Share this question
or