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

barcode position using c#

5 Answers 149 Views
Barcode
This is a migrated thread and some comments may be shown as answers.
heba
Top achievements
Rank 1
heba asked on 17 Mar 2014, 09:17 AM
Hi,
I have div that has barcode and QR. I want to control position of barcode and QR ( top , left , margin ) in code behind using c# because position coming from DB. 
How can I do that ? 
Thanks

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 17 Mar 2014, 11:29 AM
Hi heba,

Please try the following C# code snippet to achieve your scenario.

C#:
string left = "25%",top="15%";
RadBarcode1.Style.Add("margin-left", left);
RadBarcode1.Style.Add("margin-top", top);

Thanks,
Princy.
0
heba
Top achievements
Rank 1
answered on 18 Mar 2014, 02:16 PM
Thanks for your help,
It work but I have another problem, I am displaying a Code11 barcode with the Text . On decreasing the ShortLinesLengthPercentage, I recently found the text got very far from the barcode. I want to control position of text How can I fix this?
0
Gorge
Top achievements
Rank 1
answered on 29 Apr 2014, 03:03 AM
hi ,how about setting text position with below codes:[code]

//Instantiate barcode object
BarCodeBuilder bc = new BarCodeBuilder();

//Set the Code text for the barcode
bc.CodeText = "9999999";

//Set the location of the code text to above the barcode
bc.CodeLocation = CodeLocation.Above;[/code]

BTW, I'm evaluating free barcode component recommended by CodePlex and trying to figure out difference this one and RedBarcode.Once I got result,I 'll share with you guys.

kind regards
0
Konstantin Dikov
Telerik team
answered on 01 May 2014, 01:01 PM
Hello Heba,

When you are changing the ShortLinesLengthPercentage to lower value, it is expected that there will be space between the text and the lines. Nevertheless, RadBarcode allows you to set the vertical position of the text through the VerticalTextPositionPercentage property. Following is a simple example demonstrating how to set both properties:
<telerik:RadBarcode runat="server" Type="Code11" ShortLinesLengthPercentage="55" VerticalTextPositionPercentage="70"
    Height="100px" Width="500px" Text="1312313"></telerik:RadBarcode>

Hope that helps.


Regards,
Konstantin Dikov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Mariah
Top achievements
Rank 1
answered on 08 May 2014, 02:46 AM
[quote]Gorge said:hi ,how about setting text position with below codes:[code]

//Instantiate barcode object
BarCodeBuilder bc = new BarCodeBuilder();

//Set the Code text for the barcode
bc.CodeText = "9999999";

//Set the location of the code text to above the barcode
bc.CodeLocation = CodeLocation.Above;[/code]

BTW, I'm evaluating free barcode component recommended by CodePlex and trying to figure out difference this one and RedBarcode.Once I got result,I 'll share with you guys.

kind regards[/quote]
so how is the result ?
Tags
Barcode
Asked by
heba
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
heba
Top achievements
Rank 1
Gorge
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Mariah
Top achievements
Rank 1
Share this question
or