Back to Devexpress

EPCDataConverter Class

corelibraries-devexpress-dot-xtraprinting-dot-barcode-dot-epc.md

latest4.0 KB
Original Source

EPCDataConverter Class

Converts data elements into the format required for EPC QR Codes.

Namespace : DevExpress.XtraPrinting.BarCode.EPC

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

NuGet Package : DevExpress.Printing.Core

Declaration

csharp
public class EPCDataConverter
vb
Public Class EPCDataConverter

Remarks

EPC QR Codes allow users to initiate a SEPA credit transfer (SCT).The following guideline contains general information about this type of barcodes and defines the data format for EPC QR Codes: Quick Response Code - Guidelines to Enable the Data Capture for the Initiation of a SEPA Credit Transfer.

The line endings that separate data elements depend on the platform: Linux and Mac use LF; Windows uses CRLF.

The following code snippet transforms separate data elements into a string that conforms to the guideline and passes it to the barcode’s Text property:

BCD
001
1
SCT
BPOTBEB1
Red Cross of Belgium
BE72000000001616
EUR20.00
CHAR

Urgency fund
Sample EPC QR code
csharp
using DevExpress.XtraPrinting.BarCode;
using DevExpress.XtraPrinting.BarCode.EPC;
using DevExpress.XtraReports.UI;
//...

XRBarCode barCode = new XRBarCode();
barCode.Symbology = new QRCodeEPCGenerator();

//...

var epcData = new EPCDataConverter() {
    Version = EPCVersion.Version1,
    BIC = "BPOTBEB1",
    BeneficiaryName = "Red Cross of Belgium",
    IBAN = "BE72000000001616",
    TransferAmount = 20,
    TransferPurpose = "CHAR",
    RemittanceInformation = "Urgency Fund",
    Information = "Sample EPC QR code"
};

barCode.Text = epcData.StringData;
vb
Imports DevExpress.XtraPrinting.BarCode
Imports DevExpress.XtraPrinting.BarCode.EPC
Imports DevExpress.XtraReports.UI
'...

Private barCode As New XRBarCode()
barCode.Symbology = New QRCodeEPCGenerator()

'...

Dim epcData = New EPCDataConverter() With {
    .Version = EPCVersion.Version1, 
        .BIC = "BPOTBEB1",
    .BeneficiaryName = "Red Cross of Belgium",
    .IBAN = "BE72000000001616",
    .TransferAmount = 20,
    .TransferPurpose = "CHAR",
    .RemittanceInformation = "Urgency Fund",
    .Information = "Sample EPC QR code"
}

barCode.Text = epcData.StringData

The resulting EPC QR Code is shown below:

You can also pass barcode data to the barcode’s BinaryData property. To do this, use the BinaryData property of the EPCDataConverter object:

csharp
//...
barCode.BinaryData = epcData.BinaryData;
vb
'...
barCode.BinaryData = epcData.BinaryData

Inheritance

Object EPCDataConverter

See Also

EPCDataConverter Members

EPC QR Code

DevExpress.XtraPrinting.BarCode.EPC Namespace