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

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

Related

ZPL - Set barcode width to fit in label

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.

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 can we control width of the barcode in zpl

I am working on conversion of pdf in to ZPL. I am using zebra programming language(zpl).
I am trying to control the barcode(any barcode) width using By command.
^By4 is giving lower width and ^By5 is going out of the box.
My use case is I want to achieve narrow bar width in float number(here 4.5). We can not pass float number in By command.
Please let me know if we can achieve this using some other method in ZPL.
You don't mention what barcode format you're using. Some of them, like 2of5, can also accept the ratio parameter for ^BY. The default is ^BY2,3, changing that to ^BY2,2 can make a smaller version:
^XA
^POI
^CFO,20
^BY5,3
^FO100,400
^BJN,100,Y,N
^FD200940^FS
^BY5,2
^FO100,700
^BJN,100,Y,N
^FD200940^FS
^XZ
This generates two barcodes in 2of5, one with the default ratio and one with a smaller ratio. The second one has a tighter barcode that uses less space. Valid values are 2.0-3.0 (although many round off to the same values) so there is some flexibility. Please note, this only works with barcode formats that are not fixed ratio formats.
You can check the manual page for ^BY in the ZPL programmers guide, p123, for the table that shows valid values and which ones round off to the same value (ie, 2.0 and 2.1 give the same results)

Code 128 (dhl) barcode and something missing in bars

Currently I'm creating dhl label using zpl command. I'm new to zpl commands.
I have used BC - zpl command for code 128 barcode. This is my code:
^BCN,,N,N^FD>:2LDE44536+99000900153004^FS
My problem: Above zpl code create barcodes, but when I check this barcode
http://barcode.tec-it.com/
value : 2LDE44536+99000900153004
my barcode bars look different.
Please guide me right format use here for get right barcode.
Thanks in advance
Have you scanned both codes to compare data? Check the manual to be sure, but the >: is specifying subset B (Normal Alpha Numeric). Your + symbol may be getting dropped.
ZPL Manual

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