Reputation: 11
I have to print data from DATA_FIELD that can contain between 5 to 50 characters and label can fit just 20 letters due i have right to left spelling words i have to print always top 20 letters from right other wise ill loose 1st words of customer name and its usually most important because contains name of the customer for example i have a code
^FO40,240^A@N,40,40,E:DAVIDBD.FNT
^FD%%Depositor%%
^FS
thats depositor name is: i dont know why its so long name -- can be variable
and i have to print always last 20 letters as: its so long name --can be variable
will be happy to get any tips or help Regards
Upvotes: 1
Views: 730
Reputation: 1278
There really isn't much ZPL can do to help. ZPL is really a page description language, not a programming language.
You will need to process the string to the correct length before adding it to your label code. If you are not using a mono spaced font, then you will have to accommodate for the variable character width.
If you are using a monospaced font you simply have to know how many characters will fit in the area you are trying to print.
If you can wrap text, you might make use of the Use the ^FB – Field Block command in the manual
Upvotes: 2