import ch.codeblock.qrinvoice.FontFamily;
import ch.codeblock.qrinvoice.OutputFormat;
import ch.codeblock.qrinvoice.PageSize;
import ch.codeblock.qrinvoice.QrInvoicePaymentPartReceiptCreator;
import ch.codeblock.qrinvoice.model.QrInvoice;
import ch.codeblock.qrinvoice.model.builder.QrInvoiceBuilder;
import ch.codeblock.qrinvoice.output.PaymentPartReceipt;
import java.util.Locale;
// ...
final QrInvoice qrInvoice = // create using QrInvoiceBuilder;
final PaymentPartReceipt paymentPartReceipt = QrInvoicePaymentPartReceiptCreator
.create()
.qrInvoice(qrInvoice)
.outputFormat(OutputFormat.PDF)
.pageSize(PageSize.DIN_LANG)
.fontFamily(FontFamily.LIBERATION_SANS) // or HELVETICA, ARIAL
.locale(Locale.GERMAN)
.createPaymentPartReceipt();
// the resulting byte array contains the payment part & receipt as PDF
final byte[] paymentPartReceiptPdf = paymentPartReceipt.getData();
// meta data for the chosen OutputFormat for convenience
final String mimeType = paymentPartReceipt.getOutputFormat().getMimeType();
final String fileExtension = paymentPartReceipt.getOutputFormat().getFileExtension();