ZPL - zebra: print justified text block without overwriting last line

Rodrigo Pires picture Rodrigo Pires · Dec 5, 2011 · Viewed 11.5k times · Source

I'm using the following command to print a justified text:

^FB1800,3,0,J^FT100,200^A0B,26,26^FH\^FDLONG TEXT TO BE PRINTED, WHICH DOESNT FIT IN ONLY 3 LINES...^FS

The command ^FB1800,3,0,J prints a field block in a width of 1800 dots, maximum 3 lines, justified.

The problem is that if the text exceeds the maximum number of lines, it overwrites the last line! :( That of course makes the text of the last line unreadable.

How can I avoid that? Does anybody know if is there a way to cut the exceeding text?

The documentation says exactly that this happens:

Text exceeding the maximum number of lines overwrites the last line. Changing the font size automatically increases or decreases the size of the block.

For reference: I'm using printer Zebra 220Xi4.

Any help would be appreciated. Thank you!

Answer

Ovi Tisler picture Ovi Tisler · Dec 5, 2011

Take a look at the ^TB command. It is preferred over the ^FB command and truncates if the text exceeds the size defined in the TB params