cancel
Showing results for 
Search instead for 
Did you mean: 

How to allign text under the barcode with same width?

Former Member
0 Kudos

Hi,

I need to put a barcode in my form with the human readable text right under it and more importantly,irrespective of the number of digits of the text number, it needs to be space out exactly equal to the barcode length.can anyone please help with text formatting here? And what if the barcode might change in future? Something like below:

IIIIIIIIIIIIIIIIIIIIIIIII

1 2 3 4 5 6 7

IIIIIIIIIIIIIIIII

1234567

Edited by: Aditi Bhandari on Nov 22, 2009 3:38 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can create 10 column template which come equi spaced automatically. After putting some logic based on number of digits in your value( suppose u have material number), you can set which value wil appear in which box.

i.e material number - 10 numbers length

i.e material number - 9 numbers length

so based on number of digits place them in respective column of template.

Answers (1)

Answers (1)

Sandra_Rossi
Active Contributor
0 Kudos

For sapscripts and smart forms (what is your techno?), SAP allows you only to print barcodes (bars), not the texts corresponding to these barcodes, so you will have to implement a custom solution.

As SAP doesn't provide you the actual width of the generated barcode, you will have to determine empirically the formula.

I think it will be rather tough to use "space" characters or font size to manage the spacing between characters.

Instead, I see 2 solutions:

- send directly the text to the printer with the right Character Per Inch value : First calculate how many characters per inch you need (barcode estimated width divided by number of characters), then use print controls HEX - ENDHEX to define the instructions in printer language (for each device type you will print to). For better rendering use fixed font (COURIER, etc.) Note that it will work for printout, but not for print preview (text won't appear at all).

- second solution would be to generate text as an image if you have such a software, and print the image. It will work well in all situations.