Need to generate this Barcode (see attached)

42 views
Skip to first unread message

John Geshrick

unread,
May 1, 2017, 1:45:08 PM5/1/17
to zxing
Gang, I need to replicate the barcode attached here. What settings, options do I need for ZXing to generate this barcode.
bar-code.png

Bas Vijfwinkel

unread,
May 2, 2017, 12:52:48 AM5/2/17
to zxing
On Tuesday, May 2, 2017 at 2:45:08 AM UTC+9, John Geshrick wrote:
> Gang, I need to replicate the barcode attached here. What settings, options do I need for ZXing to generate this barcode.

It seems to be some proprietary format.
It's not standard format because none of the barcode readers I tried seem to recognise it.

Looking at the lines, it is a UPC code but they probably made some small changes so that the barcodes cannot be read with standard UPC readers.
For example, if the contents of the barcode is made in such a way that it always fails the parity check, then it will never be accepted by a standard reader.


John Geshrick

unread,
May 9, 2017, 3:38:21 PM5/9/17
to Bas Vijfwinkel, zxing
Bas,

I was calculating checksum incorrectly.  Below is what I had to do to get it to work:

        static string CalcCheckSum(string code)
        {
            int[] check_digits = { 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3 };
            int sumDigits = 0;
            for (int i = 0; i < code.Length; i++)
            {
                int iDigit = int.Parse(code.Substring(i, 1));
                sumDigits += (iDigit * check_digits[i]);
            }
            int modCheck = ((10 - (sumDigits % 10)) % 10);
            return modCheck.ToString();
        }





--
You received this message because you are subscribed to a topic in the Google Groups "zxing" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/zxing/gLlDHz7fWBc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to zxing+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lachezar Dobrev

unread,
May 10, 2017, 5:16:28 AM5/10/17
to John Geshrick, Bas Vijfwinkel, zxing
If we take into consideration the possible Check Sum discrepancy
this looks like an UPC code.
Indeed if we correct the check-sum the bar-code should be
'210217010994', and then encode the contents using ZXing Command Line
Encoder [1] we get the attached image, which differs from the example
only by the third line from the right: the line is thin, while in the
original image it is wide.
Did *you* calculate the wrong check sum, and did you do it on
purpose, or by mistake? If that's an honest mistake you can use ZXing
Encoder to generate UPC bar-codes, but the styling (additional text
and digits) is up to you.

[1] https://github.com/zxing/zxing/blob/master/javase/src/main/java/com/google/zxing/client/j2se/CommandLineEncoder.java
>> zxing+un...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "zxing" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to zxing+un...@googlegroups.com.
upc.png
Reply all
Reply to author
Forward
0 new messages