Is there a way to use ZPL to print text with a strikethrough (a line through the text)?
I need to be able to print something and indicate that it was there. I have looked through the ZPL programming guide and I have not found any way to alter the font....
An alternative approach would be to draw a line through your text. Here is a sample. You would need to calculate the points of the line based on the coordinates of the text:
^XA
^FT62,93^A0N,42,40^FH\^FDstrikethrough^FS
^FO41,76^GB268,0,5^FS
^PQ1
^XZ
AFAIAA, No.
Could you simply draw a line over the required text? Perhaps you could use or manufacture a downloaded bitmap font which is "struck through?"
OTOH...
To underline - use a monospaced font like AA,AC,AD,AF or AG
Use
^FO350,50^AGR^FDwhatever,milk,butter,salt^FS
^FO340,50^AGR^FD ____ ______^FS
where the underline here is under milk and butter, you can adjust the offset by trimming the FO's X and Y positions by a few dots (10 X here). Naturally, that can be raised for strikethrough, too...
Related
The effect he wants to get is:
The price is normally printed
Near the price I want to print the rest of the price in superscript
At the end I want to place currency in subscript.
The problem is that I don't want to specify the location of every part of text.
^XA
^PW480
^FS
^JMA
^MMT
^LS0
^MTD
^CI28
^FO40,11
^FWN
^CF0,16.2,20.7
^FD2144
^FS
^CI28
^FO80,10
^FWN
^CF0,8,8
^FD00
^FS
^CI28
^FO100,10
^FWN^CF0,16.2,17.25
^FDEUR
^FS
^XZ
So the question is that possible to print text after text specifying location only once? Without specifying location to every part of the text?
Use ^FT instead of ^FO, and only specify the X coordinate for the first ^FT.
By default, ^FT resumes at the point where the previous formatting operation finished, and you can provide a manual override to the X and Y components separately, so you would only provide the Y override for the subsequent ^FTs and let it calculate the X automatically:
^FT40,11^A0,16.2,20.7^FD2144^FS
^FT,6^A0,8,8^FD00^FS
^FT,11^A0,16.2,17.25^FDEUR^FS
Note that you will need to adjust the Y coordinate down, because ^FO lines up with the top of the text line (letters hanging from it) and ^FT lines up with the bottom (letters standing on it).
Also note that ^CF changes the printer-wide default font, and there is no point to use it before each command. Use ^A instead as shown. You don't need to set ^CI before each command either, it is again a global setting for encoding of the entire label text.
I work with labels that have a clear portion and are covered before being affixed to assets. Is it possible to print mirrored text on a Zebra printer mirrored so that we can see the asset number on the back (sticky) side in the clear portion?
You can use the ^FP command to print text reveresed -> ^FPR:
From the ZPL docs (^FP):
^XA
^FO350,50
^FPR,10
^AV
^FDreverse^FS
^XZ
Result:
I'm working on creating a new ZPL label, and would like to draw a dashed line, but I haven't found any information on how to do that or if it's even possible.
Am I asking too much of ZPL?
You can easily create a dashed pattern with ^GF. It's not the most efficient way in terms of ZPL code size, but it's very easy to amend by hand:
^XA
^FO10,10
^GFA,100,100,50,FFFFFF0000FFFFFF0000FFFFFF0000FFFFFF0000FFFFFF0000FFFFFF0000FFFFFF0000FFFFFF0000FFFFFF0000FFFFFF0000^FS
^IS1.png,N
^XZ
Result:
You should use the zebra zpl designer program , which allows you to create the label like WYSWYG (what you see is what you get or something like that) and then print it to a file, to have a .prn file to you can inspect the code. And then you can use this site: http://labelary.com/viewer.html to prove it.
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.
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