How to add an EPC QR code to an invoice from Delphi and Lazarus

The standardization of payment systems results not only in new standards but also in new documents built on these standards. The reporting system should offer its users a fast and convenient way to create such standard documents.

EPC is a European Payments Council standard. It was designed to simplify the coding of payment information in the Single Euro Payments Area using a QR code. Such a barcode contains all the necessary information for making a payment. You can see an example of encoded information in the table below.

Service Tag:




Character set:







Red Cross





Reason (4 chars max):


Ref of invoice:

Empty line or REFINVOICE

Or text:

Urgency fund or Empty line


Sample EPC QR code

FastReport VCL has special classes of presets to simplify the arrangement of such data and organize them as objects. The TfrxEPCPaymentPreset class is designed to quickly generate a QR code in the EPC format.

Let's look at how to add an EPC QR code and connect to it the data from the example. It is based on a report from our demo application “Nested Groups”. The report has been slightly changed to display a list of purchased items for each company. We want to add an EPC QR code at the end of each company's payment document so that the client could make a quick payment.

Our report in the report designer

Select a barcode object with the “QRCode” type on the FastReport VCL components palette and place it on the footer band.

Selecting an object to create

Click on the barcode object and go to the ExpressionPreset property, expand it, and select TfrxEPCPaymentPreset in the PresetClass property.

Selecting a class of settings

The settings have been assigned and can now be accessed by expanding the DataObject property in the Object Inspector.

Barcode settings

Next, we are going to link the fields with relevant data. Drag the required fields from the data tree to the desired property in the object inspector.

Linking fields to properties

To enter static data, you need to use single quotes, because these fields are expressions. For example, you would use the format 'BE00000000000000' to specify a fixed value in the IBAN property.

Let's combine all the necessary data to make the code by assigning the appropriate properties.

Barcode settings

You can run the report and make sure that the barcode is generated in the desired format.


These are not all the possibilities of this class of settings. The DrawOptions property allows you to control frame settings and additional information in accordance with the scan2pay standard.

Display settings

Let's take a closer look at these properties:

FillColor: the background color of the barcode fill.
FrameColor: frame color with rounded edges.
FrameVisible: enables or disables the frame inside the barcode.
FrameWidth: inner frame thickness.
Hint: additional text information
HintType: determines where to show additional information:

Fill in the fields as shown in the screenshot above and run the report for execution.


As a result, we received a scan2pay barcode. These settings are unusual because the frame and text are drawn inside the object (unlike the frame around the object, for which the Frame property is responsible), and such a frame will be displayed correctly in all formats of exported files.