use of com.itextpdf.barcodes.BarcodeQRCode in project betca-tpv-core by miw-upm.
the class PdfCoreBuilder method qrCode.
public PdfCoreBuilder qrCode(String code) {
BarcodeQRCode barcodeQRCode = new BarcodeQRCode(code.trim());
Image qcCodeImage = new Image(barcodeQRCode.createFormXObject(this.document.getPdfDocument()));
qcCodeImage.setHorizontalAlignment(HorizontalAlignment.CENTER);
qcCodeImage.setWidthPercent(QR_CODE_PERCENT);
this.document.add(qcCodeImage);
Paragraph paragraph = new Paragraph(code);
paragraph.setTextAlignment(TextAlignment.CENTER);
this.document.add(paragraph);
return this;
}
use of com.itextpdf.barcodes.BarcodeQRCode in project betca-tpv-spring by miw-upm.
the class PdfTicketBuilder method qrCode.
public PdfTicketBuilder qrCode(String code) {
BarcodeQRCode qrcode = new BarcodeQRCode(code.trim());
Image qrcodeImage = new Image(qrcode.createFormXObject(this.getDocument().getPdfDocument()));
qrcodeImage.setHorizontalAlignment(HorizontalAlignment.CENTER);
qrcodeImage.setWidthPercent(50);
this.getDocument().add(qrcodeImage);
Paragraph paragraph = new Paragraph("Ref. " + code);
paragraph.setTextAlignment(TextAlignment.CENTER);
this.getDocument().add(paragraph);
return this;
}
Aggregations