Fixed datamatrix barcode dimension with variable encoded data

Hello to everybody,

 

I'm quiet new in ZPL programming, I would appreciate if somebody could help me to clarify if is there any ZPL syntax to keep a datamatrix bar code fixed dimension if the data encoded may vary from 100 to 800 characters.

The solution that I found is to increase/decrease the dimensional height of individual symbol elements (h value of ^BXo,h,s,c,r,f,g,a command), but needed extra coding.

I used the following ZPL code to print the datamatrix:

^XA

^BY0,0^FT20,450^BXN,7,200,0,0,1,~^FH^FD0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789^FS^XZ

 

Thanks and regards.

Levi.