UPC-A
Universal Product Code is a linear barcode that allows you to encode 12 characters. It was developed jointly by the Uniform Grocery Product Code Council and IBM in 1973. Its structure and purpose are similar to the well-known EAN-13 code. UPCs are designed for North America, while EANs are for Europe.
Code structure:
- start character, indicating the beginning of the code;
- a prefix that indicates the type of product – 1 character;
- manufacturer code – 5 characters;
- product code – 5 characters;
- check digit – 1 character. Calculated from the previous 11 digits using the Modulo 10 formula;
- stop character, indicating the end of the code.
There should be an empty space of about 9 modules before and after the code. This is necessary to ensure that the code is recognized by the scanner.
The code length is 12 characters, of which only 11 are encoded data, and one more is a check digit.
Each character is encoded with two bars and two spaces. A bar or space can be 1, 2, 3, or 4 modules wide (one module is 0.33mm).
The UPC-A barcode is very common in the US and Canada. It is used in supermarkets to label products.
This barcode has earned a great deal of popularity due to its compact size, ease of scanning, and the presence of a check digit to protect against reading errors.
The disadvantages of the code include the ability to encode only numbers, as well as the small size of the code, which limits the scope of its application.
To generate an UPC-A barcode in FastReport .NET, select the Barcode object at the Components Panel in the Report Designer. In the drop-down list, navigate to the "EAN/UPC" category, and then choose UPC-A:
After selecting the barcode, place it on the Report Page.
Double-click on the added barcode to open the editor. You can also open the barcode editor by clicking the button in the context menu of the added object, accessed by right-clicking:
All objects of the Barcode type have a set of properties. Here are the most commonly used ones:
Property | Description |
---|---|
Angle | Allows you to set the rotation of the object to one of the fixed angles – 0, 90, 180, or 270 degrees. |
Zoom | Sets the scaling of the barcode. This property is used only with the AutoSize property. |
AutoSize | If this property is enabled, the object will be stretched to show the entire barcode. If the property is disabled, the barcode will be stretched to the size of the object. |
ShowText | Determines whether to show the text at the bottom of the barcode. |
DataColumn | The data field from which to load the text of the object. |
Expression | An expression that returns the text of the object. |
Text | The text of the object. |
Padding | Allows you to set the padding from the edges of the object in pixels. |
WideBarRatio | This property is available for all linear barcodes. It defines the relative size of the barcode's wide bars. |
CalcCheckSum | This property is available for many linear barcodes. It determines whether to calculate the checksum automatically. If this property is disabled, the checksum must be present in the object text. |
DrawVerticalBearerBars | If this property is enabled, the side lines will be displayed for the object. |
If the ShowText
property is disabled, the barcode will look like this: