Skip to main content
All docs
V26.1
  • UPCAOptionsBuilder Class

    Builds an UPCAOptions object. Chain builder methods to configure barcode settings, then call the Build method to create the options object.

    Namespace: DevExpress.Docs.Barcode

    Assembly: DevExpress.Docs.Core.v26.1.dll

    Declaration

    public class UPCAOptionsBuilder :
        BarcodeOptionsBuilder<UPCAOptions, UPCAOptionsBuilder>

    The following members return UPCAOptionsBuilder objects:

    Remarks

    The following code snippet creates a Universal Product Code (UPC-A) barcode and specifies its settings:

    DevExpress Barcode Generator - UPC-A barcode

    using DevExpress.Docs.Barcode;
    using DevExpress.Drawing;
    using System.Drawing;
    
    var upcaCode = UPCAOptionsBuilder.Create()
        .WithBackColor(Color.LightGray)
        .WithShowText(false)
        .WithPadding(5)
        .WithBorderWidth(1)
        .WithBorderColor(Color.Blue)
        .Build();
    
    var filePath = Path.GetFullPath("upca_code.png");
    
    using var stream = new FileStream(filePath, FileMode.Create);
    using var generator = new BarcodeGenerator(upcaCode);
    generator.Export("72527273070", stream, DXImageFormat.Png);
    
    See Also