开发者

Translating overhead digit in UPC barcode

I've inherited the source to a legacy VB6 barcode library with no documentation. My understanding is it translates an 11-digit number to UPC barcode (I hope I have that right, it might be EAN-8).

As far as I can tell, the check digit (right-most trailing number) is calculating correctly, buy the overhead digit (left-most leading number) is not.

The digit is translated by converting the first digit in the source number to a corresponding ASCII value. 1 becomes Chr(34), 2 becomes Chr(35) and so on. The problem is 6 and 0 (zero). I guess 6 should be Chr(39) (apostrophe), but the barcode doesn't scan. I'm not sure what zero should be. I've tried both Chr(33) (exclamation) and Chr(45) (dash) and barcodes scan for neither. All other translated digits scan fine.

I'm hoping someone has either done this before and know what these should be, or knows a reference on the web. I've tried Googling, but all I can find is the general format of the barcode and how to calculate the check digit, but nothing on translating the overhead digit.

Edit 1: for what it's worth, I've also seen this 开发者_JAVA技巧digit refered to as a type digit and inidcator digit.

Edit 2: this is actually a bad question on my part because I didn't know what I was asking. Turns out 1) I was working with a specific commercial barcode font, and 2) I needed more than the overhead digit. I answered my own question with what I was able to find, but in all honesty my answer turns out to have very little to do with my question after all.


First, I've never done anything like this, but I have pretty good google skills. This page looks like it has some pretty complete information. The table listing the UPC / EAN guard patterns and special characters do not agree with yours though so you'll have to let me know if this was any help or a waste of time.

Translating overhead digit in UPC barcode


Turns out the real problem wasn't so much the algorithm (though it was incorrect) but that this library was written specifically for use with Wasp barcode fonts. What I was really needing was how to create the mechanical output that would then be rendered as a valid barcode by the font.

After much digging, I was able to find this page. Though written in Visual FoxPro, I was able to translate it to VB6 to create the algorithm I needed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜