1

I have a question related to this topic: New line in Zebra ZPL. I want to print a serial number, which is longer than the label. There shouldn't be a hyphen in this seral number.

It is printed by a PLC, which gets the format as ZPL from a PC. I get the ZPL file only, if the format changes. The data which have to be printed on the label will be given as variables.

I can't change the communication configuration (e.g. connect the printer directly to the PLC or change the program in the PC). This means, I can't split the serial number into two lines (like I did in another project). But, of course, I can change the PLC program, but it must be changeable to new formats without changing the PLC program again. So from my point of view, splitting the code in the PLC program is not an option.

Until now, I only had to possibility to change the code, to have automatic word wrap with a hyphen or split the serial number into two lines.

Hopefully someone has a suggestion.

With kind regards,

Alexander Härtel

Alex
  • 11
  • 3
  • If I was reading a two line serial number, I'd not be happy. If there is a way to prevent the serial number from being two lines, I think that would be a better solution. Maybe reduce the font size, or increase the label stock width, move the serial number's position on the label so that it has more space, or reduce the character count of the serial number. – EdHayes3 Jan 29 '21 at 22:40

1 Answers1

1

Use the ^FB command (field box).
The first argument is the width in dots (always in dots, this is the only command that ignores ^CU units of measurement (which is an undocumented fact)), the second argument is the maximum number of lines the box can have. (There are other arguments too.)

^FO100,350
^FB100,2
^FD1234567890^FS

Labelary example.

GSerg
  • 76,472
  • 17
  • 159
  • 346
  • Is it possible, to define the space between the lines? I forgot to tell this too. Because it is specified exactly, where the lines begin and where they end (in x and y direction). – Alex Jan 29 '21 at 13:44
  • @Alex Yes, the third parameter controls how many dots to add or remove between the lines. E.g. [`^FB100,2,10`](http://labelary.com/viewer.html?density=8&quality=grayscale&width=4&height=6&units=inches&index=0&zpl=%5EXA%0A%0A%5EA0%2C40%0A%5EFO100%2C350%5EFB100%2C2%2C20%5EFD1234567890%5EFS%0A%0A%5EA0%2C40%0A%5EFO100%2C550%5EFB100%2C2%2C-10%5EFD1234567890%5EFS%0A%0A%5EXZ). – GSerg Jan 29 '21 at 14:25