Class BarcodeEncoding
PDF Barcode Encoding Types. Please check the supported characters for each encoding type as some do not support all symbols.
Setting a BarcodeEncoding when rendering Barcodes chooses the type and design of barcode to be generated.
// Add product barcode:
var barcode = new BarcodeStamper("ABC123456", BarcodeEncoding.Code128);
pdf.ApplyStamp(barcode);
// Add QR code for URL:
var qr = new BarcodeStamper("https://example.com", BarcodeEncoding.QRCode);
pdf.ApplyStamp(qr);
// Add inventory code:
var code39 = new BarcodeStamper("ITEM-12345", BarcodeEncoding.Code39);
pdf.ApplyStamp(code39);
See: https://ironpdf.com/how-to/add-barcodes-to-pdfs/
Inheritance
Namespace: IronPdf.Editing
Assembly: IronPdf.dll
Syntax
public sealed class BarcodeEncoding : Enum
Fields
Code128
Code 128 (1D barcode format). Code 128 is a high-density linear barcode symbology defined in ISO/IEC 15417:2007. Best for shipping labels, inventory, and product identification.
Supported characters include: All alphabetic and numeric characters.// Product SKU barcode:
var sku = new BarcodeStamper("SKU-2024-001", BarcodeEncoding.Code128)
{
Width = 250,
Height = 50
};
pdf.ApplyStamp(sku);
// Shipping tracking number:
var tracking = new BarcodeStamper("1Z999AA10123456784",
BarcodeEncoding.Code128);
// Serial number with mixed case:
var serial = new BarcodeStamper("SN-abc123XYZ", BarcodeEncoding.Code128);
Most compact 1D barcode, supports full ASCII character set
Ideal for alphanumeric data, widely supported by scanners
Declaration
public const BarcodeEncoding Code128
Field Value
| Type | Description |
|---|---|
| BarcodeEncoding |
Code39
Code 39 (1D barcode format). Code 39 is a variable length, discrete barcode symbology. The Code 39 specification defines 43 characters. Common in automotive, defense, and government applications.
Supported characters include: Digits from (0-9), Uppercase (A through Z), and these symbols: (-.$/+% space)// Part number (uppercase only):
var part = new BarcodeStamper("PART-12345", BarcodeEncoding.Code39);
pdf.ApplyStamp(part);
// Military/DoD labeling:
var mil = new BarcodeStamper("NSN-5965-01", BarcodeEncoding.Code39);
// VIN number for automotive:
var vin = new BarcodeStamper("1HGBH41JXMN109186", BarcodeEncoding.Code39);
Industry standard for automotive and defense
Limited to 43 characters - uppercase letters, numbers, and special symbols only
Declaration
public const BarcodeEncoding Code39
Field Value
| Type | Description |
|---|---|
| BarcodeEncoding |
QRCode
QR Code (2D barcode format). QR code (abbreviated from Quick Response Code) is a machine-readable optical label that contains information about the item to which it is attached. A QR code uses four standardized encoding modes to efficiently store data. Perfect for mobile scanning, URLs, contact information, and large data storage.
Supported characters include: All numeric, alphanumeric, byte/binary, and Japanese kanji.// Website URL:
var qr = new BarcodeStamper("https://ironpdf.com",
BarcodeEncoding.QRCode);
pdf.ApplyStamp(qr);
// Contact vCard:
var vcard = @"BEGIN:VCARD
VERSION:3.0
FN:John Doe
TEL:555-1234
EMAIL:john@example.com
END:VCARD";
var contact = new BarcodeStamper(vcard, BarcodeEncoding.QRCode);
// WiFi credentials:
var wifi = "WIFI:T:WPA;S:NetworkName;P:Password;;";
var wifiQR = new BarcodeStamper(wifi, BarcodeEncoding.QRCode);
// Japanese text with Kanji:
var japanese = new BarcodeStamper("ã“ã‚“ã«ã¡ã¯ä¸–界", BarcodeEncoding.QRCode);
Holds up to 4,296 alphanumeric characters or 2,953 bytes of binary data
Supports Kanji, making it ideal for Asian markets
See: https://ironpdf.com/examples/qr-code-generator/
Declaration
public const BarcodeEncoding QRCode
Field Value
| Type | Description |
|---|---|
| BarcodeEncoding |
value__
Declaration
public int value__
Field Value
| Type | Description |
|---|---|
| System.Int32 |