Skip to main content

Intelligent Mail

  • 2 minutes to read

Intelligent Mail (IM) is a 65-bar USPS barcode for mail in the United States. The symbology replaces POSTNET and PLANET and is also known as One Code Solution or 4-State Customer Barcode (4CB, 4-CB, USPS4CB).

View Example

Examples

Configure Barcode Settings (IntelligentMailOptions)

Use the IntelligentMailOptions class to configure Intelligent Mail barcode settings.

The following code snippet creates the Intelligent Mail barcode and customizes its options:

DevExpress Barcode Generator - Intelligent Mail

using DevExpress.Docs.Barcode;
using DevExpress.Drawing;
using System.Drawing;

var imOptions = new IntelligentMailOptions();
imOptions.BackColor = Color.LightGray;
imOptions.ShowText = false;
imOptions.Padding = new Padding(5);
imOptions.BorderWidth = 1;
imOptions.BorderColor = Color.Blue;

using var imOptionsStream = new FileStream(Path.Combine(outDir, "barcode_symbology_intelligent_mail.png"), FileMode.Create, FileAccess.Write);
using var imOptionsGenerator = new BarcodeGenerator(imOptions);
imOptionsGenerator.Export("92123912345678123456", imOptionsStream, DXImageFormat.Png);

Configure Barcode Settings (Fluent API)

Use the IntelligentMailOptionsBuilder class to configure Intelligent Mail barcode settings with Fluent API.

The following code snippet creates the Intelligent Mail barcode and customizes its options:

DevExpress Barcode Generator - Intelligent Mail barcode

using DevExpress.Docs.Barcode;
using DevExpress.Drawing;
using System.Drawing;

var mailCodeOptions = IntelligentMailOptionsBuilder.Create()
    .WithBackColor(Color.LightGray)
    .WithShowText(false)
    .WithPadding(5)
    .WithBorderWidth(1)
    .WithBorderColor(Color.Blue)
    .Build();

var filePath = Path.GetFullPath("intelligent_mail_barcode.png");

using var stream = new FileStream(filePath, FileMode.Create);
using var generator = new BarcodeGenerator(mailCodeOptions);
generator.Export("92123912345678123456", stream, DXImageFormat.Png);

Symbology-Specific Options

This symbology has no additional options.

See Also