ZPL Code 128 doesn't match mPDF Code 128 output - mpdf

I'm trying to print a Code 128 (Subset A?) barcode to a Zebra label printer. It looks to be printing, and can be scanned by ZXing barcode scanner on my phone, but when using a barcode scanner, it won't read.
Generating the same barcode using MPDF (type="C128A"), generates a barcode with different bars that the barcode scanner we're using does read.
Here's my ZPL: (ZPL Output)
^XA
^BY4,2,164^FT70,330^BCN,,Y,N,Y,N
^FD>9171716171724161925^FS
^XZ
And the equivalent barcode tag used in mPDF: (mPDF Output)
<barcode code="110118039" type="C128A" size="1.5"/>
Any ideas what I'm doing differently between the two would be greatly appreciated.

Looks like the issue was scanner configuration at the user end. Despite the differences in bars, both of the above are actually reading correctly.

I noticed a few problems
You have a ">" in your ZPL within the FD field.
The data you have encoded is not the exact number you are trying to get a barcode for. I wonder how you got what you got, and how it's generating the desired number.
I see you are using the UCC Check Digit = Y parameter. Default is N. You probably don't need this parameter.
Proper ZPL:
^XA
^FO100,100^BY3
^BCN,100,Y,N,N
^FD110118039^FS
^XZ

Related

Zebra Barcode prints, but doesn't scan

I need to print a 17 digit barcode. Values are coming from parameters. Barcode is printed ok, all parameters are there, it looks good, but it doesn't scan anything with the scanner.
This is what i tried:
^XA
^BY2,2,5^FO05,800
^BCN,100,Y,N,N^FV#01/ProductionNumber;02/02;03/ProductionNumber;04/Application;05/param_ProdNumber;07/10#^FS
^XZ
Image: https://ibb.co/2nFNvdR?fbclid=IwAR0H5ptpw0uTsiqFpGLhelp5AXABvZb1XBaHl0CFKD8XYsGb2lW0OKHLyiw
Your printer is lopping off the right 3 characters. That's the number 5, the checksum, and the stop character.

ZPL - How to embed GS1 application identifiers into GS1 QR code

I'm trying to code a GS1 compliant QR code in ZPL which will inlcude a number of application identifiers. I don't understand how to embed the FNC1 character within the ^FD string when using ^BQ to create a 2d code.
Below is my first attempt. When creating a GS1-128 barcode, I would use the >8 character to denote variable length fields.
^FX Test^FS
^XA^MCY^XZ
^XA^LH0,65
^LH0,0^FS
^BQN,2,10^FD>;>83018099999>82411184174>810MFATA00001>891EA^FS
^PQ1,0,0,N
^XZ
This creates a 2d barcode that returns the following string when scanned, but is not recoginised as GS1 compliant.
11611193018099999>82411184174>810MFATA00001>891EA
How do I configure the ^FD field to enable the FNC1 character?
QR ZPL Issues
See a recent answer I had for QR codes here:
Print ZPLII QR to open url
You are missing some of the parameters for the ^BQ and ^FD commands.
GS1 QR Issues
Research I've done indicates that the GS1 QR code is quite proprietary, and does not seem to be easily generated with ZPL. However, you can use a Data Matrix barcode quite easily.
Looks like you are trying to create a code with the following Application Identifiers and values:
30: Variable Count of Items: 18099999
241: Variable Customer Part Number: 1184174
10: Variable Batch/Lot Number: MFATA00001
91: Variable Company Internal: EA
GTIN 01 seems to be required and is missing. I've added a temporary GTIN string. Customer part number 241 seems to be local only, and may not validate in some applications which validate global requirements.
Full Barcode String.
^FD_10112345678901234_110MFATA00001_13018099999_12411184174_191EA^FS
Full ZPL for sample label
^XA
^FO10,10
^BXN,9,200,40,40,,_
^FD_10112345678901234_110MFATA00001_13018099999_12411184174_191EA^FS
^XZ
Hope that helps.
https://www.gs1.org/docs/barcodes/GSCN_16_477_FNC1.pdf
https://www.zebra.com/us/en/support-downloads/knowledge-articles/creating-gs1-barcodes-with-zebra-printers-for-data-matrix-and-code-128-using-zpl.html
EdHayes3's answer is just great.
As specified by Zebra in a ^BX the escape character is the underscore and the subsequent number defines what kind of FNC is used.
_1 - > FNC1
_2 - > FNC2
_3 - > FNC3
FNC4 is not supported according to how I understand the Zebra documentation.
The only thing I do not entirely agree with is escaping every GS1 AI since the most common ones except Lot/Batch number have a fixed length.
In other words, I do not think that it is necessary to escape for example the GTIN. Though, you probably have to keep in mind to pad it up with leading zeros in case of GTIN-12 or GTIN-13.

Why does contents of ^FN1 in ZPL not show all content when used in ^BQ command with ^FD?

I am looking for some direction here, as I seem to be missing something. I have the following ZPL that is loaded into a ZD620:
^XA
^LH0,0^LRN^FT100,50,0^A0N,30,30^FN1^FDCORELIMS.BARCODE^FS
^FO471,27^BQN,1,3^FDQA,^FN1^FS
^FT381,188^A0N,50,68^FD^FN1^FS
^XZ
I use an off-the-shelf software that turns CORELIMS.BARCODE into the entity's barcode value to be encoded. That works fine. What is not happening, when the Generated QR Code is scanned, the output is always missing the first 3 characters. What should show up is something like: 5BX10, what I get is: 10.
During my troubleshooting I used the following code and I receive the full string:
^XA
^LH0,0^LRN^FT100,50,0^A0N,30,30^FN1^FDCORELIMS.BARCODE^FS
^FO471,27^BQN,1,3^FDQA,5BX10^FS
^FT381,188^A0N,50,68^FD^FN1^FS
^XZ
All other fields using the ^FN1 command (including this one: ^FT381,188^A0N,50,68^FD^FN1^FS) output the correct value, just not the generated QR code.
I found similar questions, however, none of which are using a ^FN command, and their suggestions do not work for my situation. Those links are listed here:
Print ZPLII QR to open url
ZPL QR code not printing what is in the string
Thanks for help and I would really like to learn what I am doing wrong.
The ^FNx commands are used with stored formats; they cannot be used in a "one-off" label format like you are showing. I am traveling and don't have a zebra printer to test this but basically you need to define the label format "template" using ^DF like:
^XA
^DFR:MYFORMAT.ZPL^FS
^LH0,0^LRN^FT100,50,0^A0N,30,30
^FO471,27^BQN,1,3^FN1^FS
^FT381,188^A0N,50,68^FN1^FS
^XZ
That stores the format as R:MYFORMAT.ZPL. Then you use ^XF to recall the format and provide the values for the ^FNx:
^XA
^XFR:MYFORMAT.ZPL^FS
^FN1^FDQA,CORELIMS.BARCODE^FS
^XZ
Note that you include the extra data params required by ^BQ in the ^FD string.
Hope that helps.

Given final block not properly padded. Such issues can arise if a bad key is used during decryption

Hi guys I encrypted school project but my AES saved txt has been deleted, I pictured it before and I filled a new file. But new AES key file is not equal to the typed in jpeg file. Which character is wrong I couldn't find it. Could you please help me.
Pic : https://i.stack.imgur.com/pAXzl.jpg
Text file : http://textuploader.com/dfop6
If you directly convert bytes with any value to Unicode you may lose information because some bytes will not correspond to a Unicode character, a whitespace character or other information that cannot be easily distinguished in printed out form.
Of course there may be ways to brute force your way out of this, but this could easily result in very complex code and possibly near infinite running time. Better start over, and if you want to use screen shots or similar printed text: base 64 or hex encode your results; those can be easily converted back.

DataMatrix barcode with non-Latin characters

I need to create DataMatrix barcodes which may contain non-Latin characters. I have code which creates the barcodes correctly when they only consist of Latin characters; when I run the same code with non-Latin (Hebrew or Russian) characters, however, although the code runs to completion and the barcode is created, the non-Latin characters are not deciphered by the barcode reader.
Any assistance or ideas would be greatly appreciated!
Your issue is related to the character encoding used prior to generating the barcode. The encoding used by the generator to encode must match the encoding used by the reader to decode.
Possible encodings are:
Extended Channel Interpretations (ECI) is supported by DataMatrix and other 2D barcode standards. The generator places an ECI identifying code inside the barcode data, so the reader knows to use ECI to correctly convert the data back to text.
UTF-8 encodes pretty much any language.
Code page is an older encoding, but if your generator is using it, you can use 1255 for Hebrew code page or 1251 for Russian code page. See this SO answer for more info.
To test your encoding, try Inlite's Online Barcode Reader (OBR) which should read the correct text for ECI and UTF-8 encoded barcodes. If it does, the problem is with your barcode reader which is not decoding correctly.
If OBR returns binary data, either your generator uses code page or does not encode correctly at all. Try another generator that supports ECI or UTF-8.

Resources