iMZ320 - ZPL TextBlock not wrapping (^TB)

Hi,

 

I am developing a Xamarin mobile application to print receipts via bluetooth and need to be able to wrap text with ZPL.

I am using an iMZ320 Printer with Firmware version v73.19.15Z.

 

When I initially connect to printer, I ensure I set the device language to ZPL. When complete I check the language and it is set as 'hybrid_xml_zpl'.

 

I am trying to run a quick test with the following commands:

 

^XA

^PW600

^LL700

^FO40,200,0

^AE,N,15,10

^TBN,300,400

^FDThis is a test string to see if the text is wrapped inside the text block at all

^FS

^XZ

 

Unfortunately it is not wrapping the text to the next line, instead it overlaps the text over itself on the same line (See attached image).

Is there anything I am doing wrong? The documentation suggests that ^TB is available only for printers with firmware version V60.14.x, V50.14.x, or later.

 

Appreciate any assistance on this as I am relatively new to ZPL and mobile printing.

 

Thanks.

Samantha Corn
Hi John,And alternative to

Hi John,

And alternative to ^TB is ^FB, which has no firmware restrictions. Complete information on this command can be found on page 160 of this ZPL guide, but try changing the ^TBN,300,400 to ^FB300,400.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


John Ferlazzo
Hi Samantha,Thank you for the

Hi Samantha,

Thank you for the response. I have tried using ^FB but it isnt quiet doing what we need.

We have custom templates that feed us a textblock size with fixed height and width attributes. The data that gets populated is very variable so we need to make sure that is stays within the fixed size and is trimmed if it exceeds the size.

If I used FieldBlock, I would need to specify the maximum number of lines instead of a height on the block. So in the case above I would need to specify 8 lines.

^XA

^PW600

^LL700

^FO40,200,0

^AE,N,15,10

^FB300,8

^FDThis is a test string to see if the text is wrapped inside the text block at all

^FS

^XZ

The alternative to this is I would probably need to find a way to calculate the maximum number of lines based on a height that has been provided to me (in MM).

Does anyone know a way I can calculate the size of a line (in dots) based on a mm measurement? From there I can simply specify the maximum number of lines.

Thanks.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Samantha Corn
Hi John,The iMZ320 printers

Hi John,

The iMZ320 printers have a resolution of 203 dpi (8 dots/mm). You should be able to use that to calculate the dots in the line. If your application is meant to be used with other printers, you can check the resolution of a connected printer using this command: ! U1 getvar "head.resolution.in_dpi"

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


John Ferlazzo
Hi Samantha,Thank you for the

Hi Samantha,

Thank you for the help.

I found the issue was caused because I incorrectly assigned the font as ^AE,N,15,10 instead of ^AEN,15,10

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments