PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Bar code center
Bar code center
Iniciado por guest, 19,sep. 2015 00:46 - 1 respuesta
Publicado el 19,septiembre 2015 - 00:46
There is a line of string at the bottom of bar code.
Can I center this string here?

Thank you.
Publicado el 20,septiembre 2015 - 08:34
Hi, the function iPrintBarcode has the option BC_CenterH, which allows you to center the Barcode in a given area. You just have to center the text translation of the barcode below.
a) you may have defined it in millimeters already. Let's say its a real and named MyBarCodeWidth
b) find out the width of the text to print with iTextWidth(..)
c) iPrint the text starting in the x-axis from SpaceFromLeftMarginToBarcode + (MyBarCodeWidth/2 - iTextWidth(Your Text)/2) - it will be centered then.