ZPL - Set barcode width to fit in label - barcode

I have the following ZPL code:
^XA
^MMT
^FT450,30^A0,N,10,20^FH\^FDValid Until^FS
^FT435,44^A0,N,13,20^FH\^FD17/02/2037^FS
^FT20,90
^BY1,1,23
^B3N,N,35,N,N
^FD3800231000010087005792152521000235^FS
^FT260,190^A0,N,11,16^FH\^FDSN: 00059 0036712924^FS
^XZ
I need to reduce the barcode width, ideally to end where the date start.
Checking online I saw that most of answer suggest to set ^BY1,1, but still the barcode is too long.

You cannot just shrink the size of a barcode. The lines that are 1px wide cannot be shrunk any further.
Seems you are encoding: 3800231000010087005792152521000235. That's quite a bit for a 1D Code 39 barcode. A Code 128 code (^BC) is a bit more condensed. Else, try a 2D barcode (like QR or Datamatrix) if you want to encode that much data.

Related

Cannot read barcode produced by ZPL Code 39

I am trying to print a barcode (code 39) to a label (2" x .75") on a Zebra ZT610 (600 DPI) printer, but none of our 3 barcode scanners will decode the barcode. We are encoding a 14-character alphanumeric value. I created the label using ZebraDesigner, and passed the ZPL to the printer using Zebra Setup Utilities. I also use Labelary to check the label, and change parameter values.
I have tried every conceivable combination of the ^BY and ^B3 commands I can think of, that would fit on the label, including shortening the data for testing (encode only 8 characters). Here is the latest ZPL with a barcode that should be well within the label's printable area, but scanners will not read it:
^XA~JSN^LT0^MNM^MTT^PON^PMN^LH0,0^JMA^PR2,2~SD15^JUS^LRN^CI0^XZ
^XA^MMT^PW1200^LL0449^LS0^XZ
^XA^BY4,3,143^FT82,192^B3N,N,,N,N
^FD2116A83034137M^FS
^FT39,258^AAN,45,25^FH^FD2116A83034137M^FS
^PQ1,0,1,Y^XZ
Unreadable label image:
We also have an old Zebra R110Xi4 (203 DPI) printer that we also print code 39 barcodes to, on the same labels. The barcodes on these labels are perfectly readable by the scanners. This is the ZPL for it:
^XA~JSN^LT0^MNM^MTT^PON^PMN^LH0,0^JMA^PR8,8~SD30^JUS^LRN^CI0^XZ
^XA^MMT^LL0102^PW379^LS0^XZ
^XA^BY1,3,40^FT50,54^B3N,N,,N,N
^FD2116A83034137M^FS
^FT0,73^ABN,11,7
^FD2116A83034137M^FS
^PQ1,0,1,Y^XZ
Are there any suggestions as to what I might try next?
Thank you!

How to dimension the length of the barcode in 128 code format?

Please help me with the following situation.
Using ZPL script I generated a barcode, Code 128.
My interest is to size it within all length of the label.
The label size is 100mm x 100mm.
As you can see in the image below, the configuration of the label is 100mm by 100mm, and what I want is to be able to lengthen the barcode to the full length that can be scanned.
Thank you very much.
^XA
^BY2,2,140
^FO70,620^BC^FD(00)340752131001828751^FS
^PQ1
^XZ

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.

ZPL - How to format a Code 93 barcode (^BA) to fit the label

I'm using the ZPL - Zebra Programming Language to format a Code 93 barcode ^BA to reside within a label.
I know I can set the default module width using ^BY. My problem is that ^BY1 makes the barcode to small to read and ^BY2 makes it too large for the label.
This is the code:
^FO15,110^BY2,3,35^BAN,35,N^FD001EC0A688E2^FS
I wish I could use decimal values with ^BY but that doesn't seem to be possible.
Some barcodes as Code 128 ^BC have a mode parameter to pack the bar code better based on the data but ^BA doesn't have that.
I saw that some barcodes as QR (^BQ) do have a magnification factor parameter but that's also missing for ^BA.
Are there any other ways to set the width with smaller steps than ^BY?
The label is 38 mm wide and 19 mm tall and the DPI is 203 (8 dots/mm) and the data is always 12 hexadecimal characters [0-9 and A-F].
^BY does allow decimals in the second parameter (2.0 to 3.0) but that only applies to variable-ratio barcodes and code-93 is fixed-ratio.
The problem is that you need to think in terms of dots. Setting the narrow-bar width to 2 (as in ^BY2) means that the wide bar is then 4 or 6 dots (^BY2,2 or ^BY2,3) so the physical result is that the data content is always going to be (3 bars + 3 spaces)*datalength which translates to a particular number of dots.
The dot pitch is commonly 203dpi but 300dpi are available (you don't say which model you are using.) The barcode width when printed thus depends dirctly onthe amount of data and barcode type you are using. It's not like laser-printers where 1200dpi is common - the dots are six times bigger.
So - you'd need to say how wide you can handle, which model you are using and what your data characteristics are (your sample shows 12-character hexadecimal - are you using full ASCII or could you adjust and use numeric-only?) Are you stuck on code-93 or will some other encoding be OK?
Have you tried ^BY2,2? That will use a smaller ratio, but larger base.
If you want a more detailed answer you will need to provide: DPI, print width and max amount of data you are trying to encode.

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