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

    Builds an PharmacodeOptions 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 PharmacodeOptionsBuilder :
        BarcodeOptionsBuilder<PharmacodeOptions, PharmacodeOptionsBuilder>

    The following members return PharmacodeOptionsBuilder objects:

    Remarks

    The following code sample creates a two-track Pharmacode barcode and specifies its settings:

    DevExpress Barcode Generator - Pharmacode barcode

    using DevExpress.Docs.Barcode;
    using DevExpress.Drawing;
    using System.Drawing;
    
    var pharmacode = PharmacodeOptionsBuilder.Create()
        .WithPharmacodeType(PharmacodeType.TwoTrack)
        .WithBackColor(Color.LightGray)
        .WithShowText(false)
        .WithPadding(5)
        .WithBorderWidth(1)
        .WithBorderColor(Color.Blue)
        .Build();
    
    var filePath = Path.GetFullPath("pharmacode_barcode.png");
    
    using var stream = new FileStream(filePath, FileMode.Create);
    using var generator = new BarcodeGenerator(pharmacode);
    generator.Export("123456", stream, DXImageFormat.Png);
    
    See Also