PDF UPCA is a fixed length, numeric only, continuous symbology, also known as Universal Product Code version A. UPCA barcode is widely used in the United States, Canada, the United Kingdom, Australia, New Zealand for scanning of trade items at the point of sale.

.NET PDF UPC-A Creator offers the most mature and complete barcode generating APIs for developers to create amazing, fully-featured barcode encoding applications to create and make barcode from multiple Visual .NET applications, such as C#.NET, VB.NET, ASP.NET and .NET WinForms. This tutorial article mainly demonstrates the 1D UPC-A barcode creating on PDF document pages in an easy way.


// Create a new PDF document.
PdfDocument document = new PdfDocument();

// Create a page.
PdfPage page = document.AddPage();

// Get graphics object from pdf page
XGraphics g = XGraphics.FromPdfPage(page);

// Create a pdf barcode object
PdfBarcode barcode = new PdfBarcode();

// Set the barcode type to upc-a symbol
barcode.BarType = BarCodeType.UPCA;

// Input the barcode data content
barcode.Data = "123456789012";

// Change foreground and background color of barcode
barcode.BarcodeColor = XColors.Black;
barcode.BackgroundColor = XColors.White;

// Set 1d barcode human-readable text to display
barcode.ShowText = true;
                       
// Set the barcode Position and location
barcode.Location = new XPoint(100, 100);

// Set the barcode width and height
barcode.Size = new XSize(200, 50);

barcode.DrawBarcode(g);

// Save and show the document           
document.Save("Barcode.pdf");
Process.Start("Barcode.pdf");

More PDF tutorial