The code below shows how to create the QR-Code only.

import ch.codeblock.qrinvoice.OutputFormat;
import ch.codeblock.qrinvoice.QrInvoiceCodeCreator;
import ch.codeblock.qrinvoice.model.QrInvoice;
import ch.codeblock.qrinvoice.model.builder.QrInvoiceBuilder;
import ch.codeblock.qrinvoice.output.QrCode;

// ..

final QrInvoice qrInvoice = // create using QrInvoiceBuilder;

final QrCode qrCode = QrInvoiceCodeCreator

// the resulting byte array contains the Swiss QR Code as PNG
// please note that the size (pixels) varies
final byte[] qrCodeImage = qrCode.getData();

// metadata for the chosen OutputFormat for convenience
final String mimeType = qrCode.getOutputFormat().getMimeType();
final String fileExtension = qrCode.getOutputFormat().getFileExtension();
Swiss QR Code