In the code below, the values of width of narrow and wide bars are held by the WIDEBAR_WIDTH and NARROWBAR_WIDTH constants. If luck will have it, I will soon follow this article with another one that will show how to create Code128 barcodes and I will put that in the same Namespace. Let's start by assigning the class, named Barcode39, to a Namespace Barcodes. In the article, I will show the VB.NET code but the same class will be available in C# for download. Now that we have somewhat of an idea of how data is encoded in a code 39 barcode, let's see how to build our class. The above algorithm is also taken from Wikepedia. The remainder is the value of the checksum character to be appended.Take the value (0 through 42) of each character in the barcode excluding start and stop codes.Here is how the checksum calculation is done: To calculate the check sum digit, each character is assigned a value (see following table). Lower case letters, additional punctuation characters and control characters are represented by sequences of two characters of Code 39 (see the following 39 can have an optional modulo 43 check digit. In it, the symbols 0-9, A-Z, ".", "-" and space are the same as their representations in Code 39. This extension is called Full ASCII Code 39. While a “pure” Code 39 barcode is restricted to the 43 characters that are listed above, there is extension of Code 39 that allows all ASCII characters to be represented. The width ratio between narrow and wide may be chosen between 1:2 and 1:3. Where b and w stand respectively for narrow bar and narrow space B and W for wide bar and wide space. Three of the nine elements in each character are wide (binary value 1), and six elements are narrow (binary value 0). an additional character (denoted '*') is used for both start and stop delimiters.Įach character is composed of nine elements: five bars and four spaces.and a number of special characters (.But just to refresh everyone's memory, according to Wikipedia, “Code 39 (also known as Alpha39, Code 3 of 9, Code 3/9, Type 39, USS Code 39, or USD-3) is a variable length, discrete barcode symbology.” Still following the information available on Wikipedia, the Code 39 specification defines 43 characters, consisting of : If you are reading this note, chances are that you already know what that is. I will not explain what a Code 39 barcode is. The purpose of this article is to create a simple class that will generate the image of a Code 39 barcode from a string as input.
0 Comments
Leave a Reply. |