UPC-A Barcode FAQ in C#.NET Barcode Generator DLL

C# class to set UPC-A, UPC-A+2, UPC-A+5 images and properties in .NET framework with free samples
Barcode in C# > Linear > UPC-A FAQ
Barcode Library SDK to Generate Barcode Image Using C#.NET - UPC-A Barcode FAQ in C#
UPC-A barcode library SDK for C#.NET projects is a robust and mature .NET component supports UPC-A barcode image generation and customization in C#.NET projects with fast speed and easy process. Free demo of barcode control DLL is provided with detail sample C# to create specific UPC-A barcode images in C#.NET. UPC-A barcode images generated in C#.NET can be delivered as Gif, Tiff, Bmp, Png or Jpeg formats.
This article walkthroughs the overall UPC-A barcode settings in C#.NET project with the following aspects:
  • Generate UPC-A Barcode Images Using C# Class - UPC-A Barcode Data Encoding
  • Generate UPC-A Barcode Images Using C# Class - UPC-A Barcode Special Settings
  • Generate UPC-A Barcode Images Using C# Class - UPC-A Barcode Size Adjustment
  • Generate UPC-A Barcode Images Using C# Class - UPC-A Barcode Image Customization
  • Generate UPC-Barcode Images Using C# Class - UPC-A Barcode Solution Project Support
Barcode Generator SDK to Create Barcode Image Using C#.NET - UPC-A Data Encoding
UPC-A Linear Barcode Valid Data
  • Digit numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
  • 11 digits long with a checksum character which is automatically calculated by Terrek.Barcode for C#.NET
UPC-A C#.NET Sample Code:
barcode. Symbol = BarcodeSymbol.UPCA;;
barcode.BarcodeData = "12345678901";
UPC-A Human-readable Text
With barcode library SDK for C#.NET, it is easy to enable or disable the human-readable text in UPC-A symbols. In some occasions, users may disable the human-readable text and replace with other characters such as company logo, telephone, fax, etc.
UPC-A C#.NET Sample Code:
barcode.DisplayData = true;
barcode.TextStyle = new Font("Arial", 9f, FontStyle.Regular);
barcode.TextColor = Color.Gray;
barcode.TextSpace = 10;
Barcode Control DLL to Create Barcode Image Using C#.NET - UPC-A Special Settings
Generate UPC-A Add-on Barcodes 2 digits & 5 digits
Terrek.Barcode control library for C#.NET is capable of encoding UPC-A supplemental barcodes UPC-A+2 and UPC-A+5 in C#.NET projects. Programmers can use the Symbol property to create UPC-A add-on barcodes.
UPC-A C#.NET Sample Code:
barcode. Symbol = BarcodeSymbol.UPCA_AddOn2
or
barcode. Symbol = BarcodeSymbol.UPCA_AddOn5
UPC-A Add-on Symbol Settings
To generate UPC-A+2 or UPC-A+5, developers need to adjust the AddOnData, AddOnHeight, AddOnMargin respectively. The default values are built in barcode control SDK, but the adjutment is simple.
UPC-A+2 C#.NET Sample Code:
barcode.AddOnData = "23";
barcode.AddOnHeight = 0.8;
barcode.AddOnMargin =7;


UPC-A+5 C#.NET Sample Code:
barcode.AddOnData = "12345";
barcode.AddOnHeight = 0.7;
barcode.AddOnMargin =10;
Barcode Component Software to Generate Barcode Image Using C#.NET - UPC-A Size Modification
UPC-A UOM (Unit of Measure)
Set property MeasuringUnit for properties BarWidth, BarHeight, MarginL and MarginT. Valid values are PIXEL, CM and INCH. Default is PIXEL. With this UOM setting, users can control the whole barcode size to a unique type.
UPC-A C#.NET Sample Code:
barcode.MeasuringUnit = MeasuringUnit.INCH;
UPC-A Module Size
UPC-A bar size refers to the BarWidth and BarHeight of a module bar. When developers need to create barcodes with a fixed bar width, these two properties need to be implemented. With the ImageResize applied, image width & image height are changed according to the customization of bar width and bar height.
UPC-A C#.NET Sample Code:
barcode.ImageResize = true;
barcode.BarWidth = 2;
barcode.BarHeight =70;
UPC-A Image Size
UPC-A image size refers to the whole barcode image size including image width and image height. If the module size is unknown, you can set the ImageHeight and ImageWidth directly with the applying of ImageResize to true. The generated UPC-A strictly conforms to International Standard ISO/IEC 15420.
UPC-A C#.NET Sample Code:
barcode.ImageWidth = 100;
barcode.ImageHeight = 100;
UPC-A Margin Size
Increasing the width of margins around the symbol is one way to enhance the readability of the UPC-A barcode image. The barcode control library set the left, right, top, and bottom margins separately with float values. The default value is 0.
UPC-A C#.NET Sample Code:
barcode. MarginL = 8;
barcode. MarginR = 8;
barcode. MarginT = 8;
barcode. MarginB = 8;
Barcode Component DLL to Generate Barcode Image Using C#.NET - UPC-A Image Adjustment
UPC-A Image Format
UPC-A is generated as image in C#.NET projects with Terrek.Barcode library SDK. The type is System.Drawing.Imaging.ImageFormat. The valid image format values are Gif, Tiff, Bmp, Png, Jpeg, etc. Please ensure the accordance of image format and suffix of image file name.
UPC-A C#.NET Sample Code:
barcode.BarcodeFormat = System.Drawing.Imaging.ImageFormat.Png;
barcode.drawBarcode("C:\\upca.png");
UPC-A Image Resolution
DPI (Dots per inch) is used commonly as the measure of printing resolution. The resolution of image generated by UPC-A generator could be managed with DPI. The type is int, default value is 96 dpi. Users can change the resolution via DotsPerInch property.
UPC-A C#.NET Sample Code:
barcode.DotsPerInch = 163;
UPC-A Image Position
The created UPC-A is flexible to change the placement in C#.NET projects. By customizing the BarAlign properly, the image is presented left, right or center in documents or projects. By changing Rotation property, the image can be rotated to 90, 180, and 270 degrees. The default is 0 degree.
UPC-A C#.NET Sample Code:
barcode.Rotation = Rotation.Degree270;
barcode.BarAlign = BarAlign.Left;
UPC-A Image Color
It is able to change barcode colors with barcode control library DLL using C#.NET class. Both background color and foreground color are easy to be changed by manipulating ImageColor and BarColor respectively. The default color is white and black.
UPC-A C#.NET Sample Code:
barcode. ImageColor = Color.White;
barcode. BarColor = Color.Black;
Barcode Library DLL to Generate Barcode Image Using C#.NET - UPC-A Development Environment
Using C# programming to create UPC-A images, there are a lot of development platforms can be implemented this barcode solution. See guide to create barcode images in C#.NET projects. And the following projects can be adopted to fulfill your UPC-A barcode images in .NET projects.
  • Windows Forms Application (design-time and runtime support)
  • Console Application (runtime support)
  • Class Library (runtime support)
  • Windows Service (runtime support)
  • ASP.NET Applications (design-time and runtime support)
  • Web Service (runtime support)
  • Crystal Report for .NET (runtime support)
  • Reporting Service Applications (design-time and runtime support)