List of usage examples for com.lowagie.text.pdf PdfContentByte setColorFill
public void setColorFill(Color color)
From source file:uk.org.rbc1b.roms.controller.volunteer.VolunteerBadgePdfView.java
License:Open Source License
/** * Adds the RBC Region's title (e.g. London and the Home Counties) to the * bottom of the badge.//from ww w .ja va2 s .c o m * * @param content to be added * @param rbcRegion RBC region */ private static void addRBCRegionFooter(PdfContentByte content) throws DocumentException, IOException { content.beginText(); content.moveText(183, 345); BaseFont bf = BaseFont.createFont(); content.setFontAndSize(bf, 9); content.setColorFill(Color.DARK_GRAY); content.showText(VolunteerBadgePdfView.BADGE_RBC_REGION); content.endText(); }
From source file:uk.org.rbc1b.roms.controller.volunteer.VolunteerBadgePdfView.java
License:Open Source License
/** * Adds a Barcode39 of the id number of a Volunteer to the Badge. * * @param content to be added//from w ww. j ava 2s .c om * @param id volunteer id * @throws DocumentException * @throws IOException */ private static void addBarcode(PdfContentByte contentByte, Integer id) throws IOException, DocumentException { Barcode39 barcode = new Barcode39(); BaseFont baseFont = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.EMBEDDED); barcode.setFont(baseFont); barcode.setSize(6); barcode.setCode(id.toString()); contentByte.setColorFill(Color.BLACK); Image baecodeImg = barcode.createImageWithBarcode(contentByte, null, null); contentByte.addImage(baecodeImg, 75, 0, 0, 35, 338, 344); }