A0N size is different than expected when printed - zpl

I have a strange problem. I got a new ZT220 printer (203 dpi - 8dpmm) and when I use simple A0N sizing to adjust font it prints font of incorrect size.
For example a simple code:
^XA
^A0N,80^FO80,80^FD1^FS
^XZ
Should print number 1 exactly 1 centimeter tall (80 / 8 = 10mm), yet it comes out at around 7mm. Any advice?
When I print a graphic, for example a box:
^XA
^FO80,80^GB80,80,1,B,0^FS
^XZ
This box comes out precisely 10x10mm.
Why is it that the font doesn't scale properly?
Note that I'm new to ZPL and this is my first Zebra printer. I use Ubuntu environment to send files to print, e.g.:
lpr -P <printer name> -o raw text.zpl
All I did was connect the printer through CUPS. Do I have to install the default fonts? If yes how do I do that on Ubuntu?

The space for characters is what you are specifying. Not all characters take up the full space. For example a lower case 'g' or 'p' would go below the bottom of the '1' character.
Also, different fonts may act differently. Try below to see how differently some behave.
^XA
^A0N,80^FO80,100^FD1gpi|0^FS
^FO80,100^GB400,80,1,B,0^FS
^A1N,80^FO80,200^FD1gpi|0^FS
^FO80,200^GB400,80,1,B,0^FS
^AbN,80^FO80,300^FD1gpi|0^FS
^FO80,300^GB400,80,1,B,0^FS
^AcN,80^FO80,400^FD1gpi|0^FS
^FO80,400^GB400,80,1,B,0^FS
^AeN,80^FO80,500^FD1gpi|0^FS
^FO80,500^GB400,80,1,B,0^FS
^AfN,80^FO80,600^FD1gpi|0^FS
^FO80,600^GB400,80,1,B,0^FS
^XZ

Related

ways to include miscellaneous symbols like Recycle, Rain on the ZPL files for printing labels

I am new to ZPL coding and am not sure how to include miscellaneous symbols like Recycle, Rain on the ZPL files for printing labels.
I tried a bit of coding in UTF-8 encoding by using ^CI28 command and converted the recycle and rain logos to hexadecimal and tried escaping the default underscores using ^FH command but no avail.
^XA
^CI28
^CFT,30,30
^FO50,50^FH^FDTesting^FS
^FO50,100^FH^FD_e2_99_b2^FS
^XZ
In UTF-16, it is printing &72 instead of recycle logo
^XA
^CI29
^CFT,30,30
^FO50,50^FH^FDTesting^FS
^FO50,100^FH^FD_2672^FS
^XZ
Also the results i checked are from simulator available in http://labelary.com/viewer.html. Not sure if there is an issue with my code or simulator in which i am seeing the output.It will be great if any ZPL coding experts can provide some pointers on this regard. Thanks in advance!
Store the images on the printer's memory, and call them up as you need them with the image command.

ZPL command how to reduce a barcode's size of the same ratio?

I would like to reduce my barcode's size but still be the same ratio like picture below.
From
Original Size
To be
Reduced Size
Here is my ZPL code.
^XA
^FO50,20
^BY2,2,20
^BCN,,N,N,N,D
^FDZWW011601512345^FS
^XZ
Please help me how do I deal with it?
Thank you.
This website is great for testing against: http://labelary.com/viewer.html.
Assuming you don't want the position to move it should just be changing
^BY2,2,20
to
^BY1,1,10
The API Reference guide can be found https://www.zebra.com/content/dam/zebra/manuals/en-us/software/zpl-zbi2-pm-en.pdf
Don't forget to take into consideration the print density, i.e. at 152 DPI you probably want something like
^FO150,20
^BY1,1,10
But at 600 DPI
^FO550,80
^BY4,1,40
EAN-13 Text Modifications
If you are using the the inbuilt EAN-13 text function i.e. ^BEN,40,Y,N you can't modify the text. It is to a standard. You can however add your own text e.g.
^XA
^FO100,20
^BEN,40,N,N
^FD011601512345^FS
^CF0,48
^FO90,80^FD011601512345^FS
^XZ
^BEN,40,N,N The first N tells the printer to not generate the number underneath.
^CF0,48 Is the select font function of the printer, its first parameter is a default printer font (can be found in the Standard Printer Fonts section of the link above). The second parameter is the font height. If needed there can be a 3rd parameter which alters the font width, though isn't needed.
^FO90,80^FD011601512345^FS Sets the field origin of the string starting at the location defined by ^FO. ^FDXXXXXXXX^FS draws the string.

Text is printed incorrectly using ZPL

I print a text using ZPL but they are printed incorrectly. It has gaps in the middle. They are printed correctly to the real printer via the ZebraDesigner. But they are wrong when printing via ZPL:
^FT246,70^A0R,16,16
^FB900,2,,
^FDMaisstaerke, Austernuce, Cashewnuss,Pilz, Mais, Lattich, Pack Choi,Sojasprossen^FS
It is printed as 'Maisstaerke, Austernuce, Cashewnuss,Pilz, Mais, Lattich, Pack Choi, Sojasprossen'
(there is a big gap after 'Mais,').
http://screencast.com/t/sTiaxC3cMg
http://screencast.com/t/0QkypnsPyF89
Please help.
Thanks
I'm unable to reproduce the issue, but the field block width seems rather large; you didn't specify any label dimensions in the original post. If you use the following code--a combination from the original post and your comments:
^XA
^PW560
^LL560
^LS0
^FO246,70^GB28,300,,^FS
^FT246,70^A0R,16,16 ^FB300,2,, ^FDMaisstaerke, Austernuce, Cashewnuss,Pilz, Mais, Lattich, Pack Choi,Sojasprossen^FS
^PQ1,0,1,Y
^XZ
I can reproduce what is possibly the issue--the field block automatic word wrapping--by reducing the field block width to 300 dots.
I also drew a box around the block for visualization. You can test in on the Labelary Viewer.
Finally, if you're somehow composing the data make sure there are no special (non printable, such as tab, non-UTF-8 or accented) characters in it, and if so, you will have to pre-escape them.

ZPL Barcode Labels setting width of label/barcode

I'm printing to a zebra thermal printer from 2 different systems, a windows environment using BarTender to print labels with a text file as the data source, and an older system (green screen) which prints using command files like below.
My problem is when I print from the windows printer, the printers settings change, so when I then print from the other system, it loses the width and runs off the edge.
I tried to add a print width setting to the code below which didn't work ,^PW700 and could do with some advice! this isn't a language I know much about. I don't know if I used the code in the right way/place or if im using the right code at all? could it be that I need to use BYw?
^XA^LL456,^PW700^LH0,0^FS
^FO21,196^B3N,N,66,N^FDWU000208375^FS
^FO18,18^A0N,24,24^FDPrd Code : 84100705 ^FS
^FO18,48^A0N,24,24^FDDANDY GREY ^FS
^FO18,78^A0N,24,24^FDQuantity Remaining : 4.00^FS
^FO18,108^A0N,24,24^FDAmended : 01/07/15 Received : 01/07/15^FS
^FO18,138^A0N,24,24^FDBATCH : 241071 ^FS
^FO18,168^A0N,24,24^FD^FS
^FO129,276^A0N,24,24^FDW U 2 0 8 3 7 5
^XZ
Thanks in advance
It might be too late to answer this question, but it might help others.
The reason your code doesn't work might cause by comma before ^PW
^LL456,^PW700
So removing it should work on any system:
^LL456^PW700
The usual command code for zpl is
^(command)(parameter),(parameter)...

ZPL - how can we increase width of ^BC (Code 128) bar code

Am doing a formatting of barcode label.
We are using Zebra Programming Language , ^BC (Code 128) bar code
As i increase the size of ^FD Field Data , the barcode width is increasing.
But how can i print a broader bar code for a fixed small length data.
I saw magnifying factor for some other types like UPC E barcode.
But i dont find any magnifying factor for ^BC code 128 barcode.
I put some space and it increase width but not effective while reading barcode
Look at the ^BY command
^XA
^FO100,100^BY7
^BCN,100,Y,N,N
^FD123456^FS
^XZ
The first parameter is the width of the barocdes after it. The default is 2, range is 1-10
To change the font, size, and placement of the text on the intrepretation line, use the ^A command
^XA
^FO100,100^BY7
^A0N,40,30^BCN,100,Y,N,N
^FD123456^FS
^XZ
I know it's too late to answer your question but I thought it might help others.
I faced the same issue and solved by this trick where I set BC mode to A (for automatic).
example:
^BY3,3,55^FT12,172^BCN,,Y,N,,A
^FD123456789^FS
this resulted a better barcode width for me than when mode is set to its default value.
Note: still you can change BY to suit your needs.
You can refer to the documentation for more information zpl BC command

Resources