Back to Devexpress

QRCodeEPCGenerator Class

corelibraries-devexpress-dot-xtraprinting-dot-barcode-730012a5.md

latest4.1 KB
Original Source

QRCodeEPCGenerator Class

Generates an EPC QR Code barcode.

Namespace : DevExpress.XtraPrinting.BarCode

Assembly : DevExpress.Printing.v25.2.Core.dll

NuGet Package : DevExpress.Printing.Core

Declaration

csharp
public class QRCodeEPCGenerator :
    QRCodeGenerator
vb
Public Class QRCodeEPCGenerator
    Inherits QRCodeGenerator

Remarks

Refer to the following topic for details on this type of barcode: EPC QR Code.

The following code creates an EPC QR Code barcode and specifies its properties:

View Example: How to Add a Bar Code to a Report

csharp
using System;
using System.Collections.Generic;
using System.Drawing.Printing;
using System.Windows.Forms;
using DevExpress.XtraPrinting.BarCode;
using DevExpress.XtraPrinting.BarCode.EPC;
using DevExpress.XtraReports.UI;
// ...
public XRBarCode CreateQRCodeEPCBarCode() {
    // Create a barcode control.
    XRBarCode barCode = new XRBarCode();

    // Set the barcode's type to QRCode.
    barCode.Symbology = new QRCodeEPCGenerator();

    // Adjust the barcode's main properties.
    barCode.Width = 400;
    barCode.Height = 400;

    var epcData = new EPCDataConverter() 
    {
        BIC = "BPOTBEB1",
        BeneficiaryName = "Red Cross of Belgium",
        IBAN = "BE72000000001616",
        TransferAmount = 20,
        PaymentReference = "Empty line or REFINVOICE"
    };

    barCode.Text = epcData.StringData;

    // If the AutoModule property is set to false, uncomment the next line.
    barCode.AutoModule = true;
    // barcode.Module = 3;

    // Set a frame that meets the Payment Services Austria standard.
    ((QRCodeGenerator)barCode.Symbology).FrameOptions = new PaymentServicesAustriaQRFrameOptions();

    return barCode;
}
vb
Imports System
Imports System.Collections.Generic
Imports System.Drawing.Printing
Imports System.Windows.Forms
Imports DevExpress.XtraPrinting.BarCode
Imports DevExpress.XtraPrinting.BarCode.EPC
Imports DevExpress.XtraReports.UI
' ...
Public Function CreateQRCodeEPCBarCode() As XRBarCode
    ' Create a barcode control.
    Dim barCode As New XRBarCode()

    ' Set the barcode's type to QRCode.
    barCode.Symbology = New QRCodeEPCGenerator()

    ' Adjust the barcode's main properties.
    barCode.Width = 400
    barCode.Height = 400

    Dim epcData = New EPCDataConverter() With {
        .BIC = "BPOTBEB1",
        .BeneficiaryName = "Red Cross of Belgium",
        .IBAN = "BE72000000001616",
        .TransferAmount = 1,
        .RemittanceInformation = "Urgency Fund"
    }

    barCode.Text = epcData.StringData

    ' If the AutoModule property is set to false, uncomment the next line.
    barCode.AutoModule = True
    ' barcode.Module = 3;

    ' Set a frame that meets the Payment Services Austria standard.
    CType(barCode.Symbology, QRCodeGenerator).FrameOptions = New PaymentServicesAustriaQRFrameOptions()

    Return barCode
End Function

Inheritance

Object DevExpress.Printing.Utils.DocumentStoring.StorableObjectBase BarCodeGeneratorBase BarCode2DGenerator QRCodeGenerator QRCodeEPCGenerator

See Also

QRCodeEPCGenerator Members

DevExpress.XtraPrinting.BarCode Namespace