Skip to main content
All docs
V26.1
  • GS1 - QR Code

    • 2 minutes to read

    GS1 QR Code is a variant of the QR Code symbology that conforms to GS1 General Specification.

    View Example

    Examples

    Configure Barcode Settings (QRGS1Options)

    Use the QRGS1Options class to configure QR GS1 barcode settings.

    The following code snippet creates a QR Code GS1 barcode and specifies its settings:

    DevExpress Barcode Generator - QR Code GS1 barcode

    using DevExpress.Docs.Barcode;
    using DevExpress.Drawing;
    using System.Drawing;
    
    using var fileStream = new FileStream("logo.png", FileMode.Open);
    
    var qrGs1Options = new QRCodeGS1Options();
    qrGs1Options.ErrorCorrectionLevel = QRCodeErrorCorrectionLevel.H;
    qrGs1Options.CompactionMode = QRCodeCompactionMode.Auto;
    qrGs1Options.IncludeQuietZone = true;
    qrOptions.Logo = DXImage.FromStream(fileStream);
    qrGs1Options.Version = QRCodeVersion.Version20;
    qrGs1Options.BackColor = Color.LightGray;
    qrGs1Options.ShowText = false;
    qrGs1Options.ModuleSize = 50;
    qrGs1Options.Padding = new Padding(5);
    qrGs1Options.BorderWidth = 1;
    qrGs1Options.BorderColor = Color.Blue;
    
    using var qrGs1OptionsStream = new FileStream(Path.Combine(outDir, "barcode_symbology_qr_gs1_code.png"),
        FileMode.Create, FileAccess.Write);
    using var qrGs1OptionsGenerator = new BarcodeGenerator(qrGs1Options);
    qrGs1OptionsGenerator.Export("(01)09521234543213(8200)https://www.devexpress.com", qrGs1OptionsStream, DXImageFormat.Png);
    

    Configure Barcode Settings (Fluent API)

    Use the QRGS1OptionsBuilder class to configure QR GS1 barcode settings with Fluent API.

    The following code snippet creates a QR Code GS1 barcode and specifies its settings:

    DevExpress Barcode Generator - QR Code GS1 barcode

    using DevExpress.Docs.Barcode;
    using DevExpress.Drawing;
    using System.Drawing;
    
    var qrgs1code = QRCodeGS1OptionsBuilder.Create()
        .WithErrorCorrectionLevel(QRCodeErrorCorrectionLevel.M)
        .WithCompactionMode(QRCodeCompactionMode.Auto)
        .WithIncludeQuietZone(true)
        .WithLogo(DXImage.FromStream(new FileStream("logo.png", FileMode.Open)))
        .WithVersion(QRCodeVersion.Version20)
        .WithBackColor(Color.LightGray)
        .WithShowText(false)
        .WithPadding(5)
        .WithBorderWidth(1)
        .WithBorderColor(Color.Blue)
        .Build();
    
    var filePath = Path.GetFullPath("qrgs1_code.png");
    
    using var stream = new FileStream(filePath, FileMode.Create);
    using var generator = new BarcodeGenerator(qrgs1code);
    generator.Export("(01)09521234543213(8200)https://www.devexpress.com", stream, DXImageFormat.Png);
    

    Symbology-Specific Option

    Property Description
    FNC1Substitute Specifies a substring/character that serves as the placeholder for the FNC1 functional character.
    See Also