We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

SwissQr: Not possible to create QR without amount

Currently there doesn’t appear to be a way to create a Swiss QR code without setting an amount. See the specifications here: https://www.paymentstandards.ch/dam/downloads/ig-qr-bill-en.pdf#page=18

This type of barcode is needed so users can use the barcode to transfer arbitrary amounts, rather than paying specific bills.

Even if the SwissQrCodetext.Bill.Amount property is not set, a line with an amount of 0.00 is still added to the QR text. As a result, the barcode fails validation.

Are there any plans to allow this in the future or is there already a way to create a Swiss QR code that doesn’t have the amount?

@SimonQuitt,

How could you create a Swiss QR code without specifying bill amount? Is this possible by some third party online tool, give details with reference URL. Also, provide us sample barcode image that can be generated by some tool or application. We will check it soon.

Thank you for your quick reply.

You can use the tool provided by the Swiss Post to create such a QR code:


Fill the data in the 4 steps but leave the amount field in the second step empty.
If you scan the QR code with your phone, you’ll see that there is no amount in the text, whereas a Swiss QR code created with Aspose will always have at least a 0.00.

This type of QR code is used by people to manually pay the QR bill: They print out the invoice with QR code, go to the post office and the guy at the post office scans in the QR bill and adds the desired amount. Unfortunately, there are still quite many people in Switzerland who don’t use online banking.

@SimonQuitt,

Thanks for the referenced online tool link.

Could you also provide your current code that you are using with Aspose.BarCode API to try to generate your desired Swiss QR code image. This will help us to evaluate your issue precisely and we could log appropriate ticket for investigations.

Could you please

Sure, here you go:

        var barcodeData = new SwissQRCodetext();
        barcodeData.Bill.Account = "CH4431999123000889012";
        barcodeData.Bill.Creditor = creditorAddress; // Address object
        barcodeData.Bill.Debtor = debtorAddress; // Adress object
        barcodeData.Bill.Reference = "113456000000001101000001106";
        barcodeData.Bill.Currency = "CHF";

        if (amount >= 0.01M && amount <= 999_999_999.99M)
        {
            barcodeData.Bill.Amount = amount;
        }

        var constructedCodeText = barcodeData.GetConstructedCodetext();
        var data = new SwissQRCodetext();
        data.InitFromString(constructedCodeText);

        var generator = new ComplexBarcodeGenerator(data);

        generator.Parameters.Barcode.QR.QrEncodeMode = QREncodeMode.ECIEncoding;
        generator.Parameters.Barcode.QR.QrECIEncoding = ECIEncodings.UTF8;
        generator.Parameters.Barcode.QR.QrErrorLevel = QRErrorLevel.LevelM;

        using (var stream = new MemoryStream())
        {
            generator.Save(stream, BarCodeImageFormat.Png);
            return stream.ToArray();
        }

@SimonQuitt,

Thanks for the sample.

I tested your scenario/case a bit. It seems if we do not specify Amount for Swiss QR code, Aspose.BarCode still sets “0” as amount field, we can confirm the amount when reading barcode from the swiss qr barcode image. I have logged a ticket with an id “BARCODENET-38194” for your issue. We will investigate and look into the details of your requirements/issue.

Once we have an update on it, we will let you know here.

Thank you for your support.

In the meantime we’ve managed to use the normal QR code generator to create a valid QR code without amount. The code is quite ugly though, so we are looking forward to the fix.

@SimonQuitt,

Alright, and sure we will be looking into your issue (logged as “BARCODENET-38194”) soon.
Once we have any new information available, we will update.

@SimonQuitt
What version of Aspose.Barcode library are you using?
Aspose.Barcode 22.3 doesn’t have this issue. If you run your code sample you can check the content of constructedCodeText:
var constructedCodeText = barcodeData.GetConstructedCodetext();
It contains an empty line were the amount should be, not a ‘0.00’ value.