KPK
KPK

Reputation: 442

ZPL Center text vertically

Is there a way in ZPL to center text vertically?

I know I can use ^FO0,0^ASN,50^FB200,3,0,C,0^FD TEXT ^FS. But how can I make that print on the 2nd line if it's short enough?

Upvotes: 0

Views: 6281

Answers (1)

user3384842
user3384842

Reputation: 446

There isn't a vertical centering feature, but you can fake it, if you know in advance that your string is short enough to fit on the middle line.

Your ^FB defines a field block that is three lines. So your best option is to determine if your string fits on one line... and if it does, insert a "\&" before your string.

^FO0,0^ASN,50^FB200,3,0,C,0^FD\&TEXT^FS

Upvotes: 5

Related Questions