List of usage examples for com.itextpdf.text.pdf PdfContentByte setLineWidth
public void setLineWidth(final double w)
From source file:de.jost_net.JVerein.io.HeaderFooter.java
License:Open Source License
/** * Adds the header and the footer./*from w ww . j a v a 2 s . c o m*/ * */ @Override public void onEndPage(PdfWriter writer, Document document) { Rectangle rect = document.getPageSize(); switch (writer.getPageNumber() % 2) { case 0: // ColumnText.showTextAligned(writer.getDirectContent(), // Element.ALIGN_RIGHT, header[0], rect.getRight(), rect.getTop(), 0); break; case 1: // ColumnText.showTextAligned(writer.getDirectContent(), // Element.ALIGN_LEFT, // header[1], rect.getLeft(), rect.getTop(), 0); break; } float left = rect.getLeft() + document.leftMargin(); float right = rect.getRight() - document.rightMargin(); float bottom = rect.getBottom() + document.bottomMargin(); PdfContentByte pc = writer.getDirectContent(); pc.setColorStroke(BaseColor.BLACK); pc.setLineWidth(0.5f); pc.moveTo(left, bottom - 5); pc.lineTo(right, bottom - 5); pc.stroke(); pc.moveTo(left, bottom - 25); pc.lineTo(right, bottom - 25); pc.stroke(); ColumnText.showTextAligned(pc, Element.ALIGN_CENTER, new Phrase(footer + " " + pagenumber, Reporter.getFreeSans(7)), (left + right) / 2, bottom - 18, 0); }
From source file:edu.cornell.mannlib.vitro.webapp.visualization.visutils.PDFDocument.java
License:Open Source License
/** * Prints a square and fills half of it with a gray rectangle. * @param x/*from w w w . j a va 2 s . co m*/ * @param y * @param cb * @throws Exception */ public void pictureBackdrop(float x, float y, PdfContentByte cb) throws Exception { cb.setColorStroke(new BaseColor(Color.black)); cb.setColorFill(new BaseColor(Color.gray)); cb.rectangle(x, y, 100, 200); cb.fill(); cb.setLineWidth(2); cb.rectangle(x, y, 200, 200); cb.stroke(); }
From source file:engine.Pdf.java
public static void drawLines(Vector<HoughLine> vectors, PdfWriter writer) { PdfContentByte canvas = writer.getDirectContent(); canvas.setColorStroke(BaseColor.RED); canvas.setLineWidth(1); for (int i = 0; i < vectors.size(); i++) { HoughLine line = vectors.elementAt(i); canvas.moveTo(line.x1, line.y1); canvas.lineTo(line.x2, line.y2); canvas.closePathStroke();// w w w .j a va 2 s .com } // canvas.closePathStroke(); canvas.setColorFill(BaseColor.BLUE); canvas.fill(); }
From source file:engine.Pdf.java
public static void drawLines(PdfWriter writer) { PdfContentByte canvas = writer.getDirectContent(); canvas.setColorStroke(BaseColor.RED); canvas.setLineWidth(3); canvas.moveTo(20, 30);/* www.j a va 2 s . c o m*/ canvas.lineTo(900, 900); canvas.lineTo(220, 330); canvas.closePathStroke(); canvas.setColorFill(BaseColor.RED); canvas.fill(); }
From source file:EplanPrinter.PDFPrint.java
License:Open Source License
public String insertStamp(String loc, float x, float y, int width, int height, int set, String date, int pageNum, int masterHeight, int masterWidth, String projNo) throws BadElementException, MalformedURLException, IOException, DocumentException { Image image = Image.getInstance(loc); float[] scalar = scale(x, y, width, height, masterHeight, masterWidth, pageNum); float[] trans = translate(x, y, r[pageNum - 1].getHeight(), r[pageNum - 1].getWidth(), masterHeight, masterWidth, pageNum);//from w ww . j av a2 s . co m float[] f = commentTrans(x, y, masterHeight, masterWidth, pageNum); float shift = 0; /* Addition. ftorres - 7/22/2015 - Added to account for rotated pages * with the origin (0,0) not set to the bottom-left of the page. [1400] */ trans = translateRotation(trans[0], trans[1], pageNum); if (set == 1) { float m = image.getPlainHeight(); float pageChunk = r[pageNum - 1].getHeight() / 10; shift = r[pageNum - 1].getHeight() / 100; scalar[1] = (int) (pageChunk); scalar[0] = (int) (image.getPlainWidth() * pageChunk) / image.getPlainHeight(); trans[0] = (int) (0 + (pageChunk * widthScalar)); trans[1] = (int) (r[pageNum - 1].getHeight() - (pageChunk * heightScalar) - (shift * (heightScalar + 2))); heightScalar = heightScalar + 1; if (heightScalar == 8) { heightScalar = 0; widthScalar = widthScalar + 2; } } if (set == 1) { image.setAbsolutePosition(trans[0] + shift, trans[1] - scalar[1]); image.scaleAbsoluteHeight(scalar[1]); image.scaleAbsoluteWidth(scalar[0]); image.setRotationDegrees(rot); } else { //swap stamp dimensions for rotated drawings if (rot > 0) { image.setAbsolutePosition(trans[0] - 2 * scalar[1], trans[1] - 2 * scalar[0]); } else { image.setAbsolutePosition(trans[0], trans[1] - 2 * scalar[1]); } image.scaleAbsoluteHeight(scalar[1] * 2); image.scaleAbsoluteWidth(scalar[0] * 2); image.setRotationDegrees(rot); } PdfContentByte fg = pds.getOverContent(pageNum); fg.addImage(image); //Added by tmittelstadt on 09/21/2012 for ticket #698 //draws a box around the date fg.setColorFill(BaseColor.WHITE); fg.setLineWidth(0f); //dmoody removed box. ticket 900 /*fg.moveTo(trans[0], trans[1] - scalar[1] * 2); fg.lineTo(trans[0], trans[1] - scalar[1] * 2 - 10); fg.lineTo(trans[0] + scalar[0] * 2, trans[1] - scalar[1] * 2 - 10); fg.lineTo(trans[0] + scalar[0] * 2, trans[1] - scalar[1] * 2); fg.lineTo(trans[0], trans[1] - scalar[1] * 2);*/ fg.closePathFillStroke(); fg.fill(); //adds the date the stamp was added to the document to the pdf Phrase p = new Phrase(date); p.getFont().setColor(BaseColor.BLACK); //Modification zreeve 10/11/2012. set font size to 11. p.getFont().setSize(9f); //p.getChunks().get(0).setAnnotation(PdfAnnotation.createText(pds.getWriter(), new Rectangle(trans[0],trans[1], trans[0]+5f, trans[1]+5f), id, comment, true, id)); ColumnText.showTextAligned(fg, Element.ALIGN_CENTER, p, (float) (trans[0]), (float) (trans[1] - scalar[1] * 2 - 12), 0); Phrase pn = new Phrase("#[" + projNo + "]"); pn.getFont().setColor(BaseColor.BLACK); pn.getFont().setSize(10f); pn.getFont().setStyle("bold"); ColumnText.showTextAligned(fg, Element.ALIGN_CENTER, pn, (float) (trans[0]), (float) (trans[1] - scalar[1] * 2 - 22), 0); return ""; }
From source file:EplanPrinter.PDFPrint.java
License:Open Source License
public String insertSketch(String points, String color, String opac, int pageNum, int masterHeight, int masterWidth, int lineWeight, String lineStyle) throws DocumentException, IOException { float f = Float.valueOf(opac); PdfGState gs1 = new PdfGState(); int t = points.indexOf("POLYGON"); gs1.setFillOpacity(f);//from w w w.ja v a 2 s . c om PdfContentByte fg = pds.getOverContent(pageNum); fg.setGState(gs1); float[] pointsSt = shatterSketches(points); color = "0x" + color.substring(1); Color c = Color.decode(color); fg.setLineWidth(lineWeight * getRatio(masterHeight, masterWidth, pageNum)); if (lineStyle.equals("dash")) { fg.setLineDash(lineWeight * 4f, lineWeight); } else { fg.setLineDash(0); } //fg.setLineWidth(5); fg.setColorStroke(new BaseColor(c.getRGB())); fg.setColorFill(new BaseColor(c.getRGB())); float[] prefl = scaleShape(pointsSt, masterHeight, masterWidth, pageNum); float[] fl = sketchTrans(prefl, pageNum); /* Addition. ftorres - 7/22/2015 - Added to account for rotated pages * with the origin (0,0) not set to the bottom-left of the page. [1400] */ float flTrans[] = translateRotation(fl[0], fl[1], pageNum); if (points.indexOf("LINEPOINT") != -1) { fg.circle(flTrans[0], flTrans[1], 5); fg.fillStroke(); if (t == -1) { gs1.setFillOpacity(0f); } else { gs1.setFillOpacity(f); } fg.setGState(gs1); } fg.moveTo(flTrans[0], flTrans[1]); for (int i = 2; i < pointsSt.length; i = i + 2) { flTrans = translateRotation(fl[i], fl[i + 1], pageNum); fg.lineTo(flTrans[0], flTrans[1]); } if (t != -1) { fg.closePathFillStroke(); fg.fill(); } else { fg.stroke(); } return ""; }
From source file:EplanPrinter.PDFPrint.java
License:Open Source License
public String insertComment(String sx, String sy, String id, String deptValue, String userInit, String comment, int pageNum, int masterHeight, int masterWidth, int pinned, int customFontSize) throws DocumentException, IOException { float ratio = getRatio(masterHeight, masterWidth, pageNum); float x = Float.parseFloat(sx); float y = Float.parseFloat(sy); float[] f = commentTrans(x, y, masterHeight, masterWidth, pageNum); PdfGState gs1 = new PdfGState(); gs1.setFillOpacity(1);/*from w w w .j av a 2s.c o m*/ if (customFontSize > 0) fontSize = customFontSize; PdfContentByte fg = pds.getOverContent(pageNum); fg.setGState(gs1); BaseFont bf = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED); float[] trans = translate(x, y, r[pageNum - 1].getHeight(), r[pageNum - 1].getWidth(), masterHeight, masterWidth, pageNum); // comment tag image (width=35pts, height=8pts) float[] scalar = scale(trans[0], trans[1], 35, 8, masterHeight, masterWidth, pageNum); /* Addition. ftorres - 7/21/2015 - Added to account for rotated pages * with the origin (0,0) not set to the bottom-left of the page. [1400] */ float coords[] = translateRotation(trans[0], trans[1], pageNum); coords = checkBounds(coords[0], coords[1], pageNum); /* Addition. ftorres - 10/20/2015 - If the comment was pinned in EPC, then * render the comment inside a comment box. */ if (pinned == 1) { insertPinnedComment(coords[0], coords[1], id + " - " + deptValue + " (" + userInit + ")", comment, pageNum, masterHeight, masterWidth); // Add the pinned comment text to page annotation -Jon Changkachith 11/24/2015 Rectangle rect = new Rectangle(0, 0, 0, 0); PdfAnnotation annotation = PdfAnnotation.createText(pds.getWriter(), rect, id + " - " + deptValue + " (" + userInit + ")", cleanupComment(comment), true, id); pds.addAnnotation(annotation, pds.getWriter().getCurrentPageNumber()); } else { Image image = Image.getInstance(commentIMGPath); image.setAbsolutePosition(coords[0] + (scalar[0] * (id.length() / 5f)), coords[1]); /* * Commented out by Jon Changkachith 12/09/2015 because it was throwing * DocumentException with the message "The image must have absolute positioning." image.scaleAbsoluteHeight(1); image.scaleAbsoluteWidth(1); */ image.scalePercent(ratio); //Added to fix DocumentException "The image must have absolute positioning." Jon Changkachith 12/09/2015 image.setAnnotation(new Annotation(id + " - " + deptValue + " (" + userInit + ")", cleanupComment(comment), 0, 0, 0, 0)); fg.addImage(image); } fg.setLineWidth(.5f * ratio); fg.setColorStroke(new BaseColor(Color.decode("0x6E2405").getRGB())); fg.setColorFill(new BaseColor(Color.decode("0x6E2405").getRGB())); float tHeight = scalar[1]; float tWidth = 0; if (id.length() > 3) { tWidth = (scalar[0] * (id.length() / 5f)); } else { tWidth = (scalar[0]); } fg.moveTo(coords[0], coords[1]); fg.lineTo(coords[0] + (10f * ratio), coords[1] - (tHeight / 2)); fg.lineTo(coords[0] + tWidth, coords[1] - (tHeight / 2)); fg.lineTo(coords[0] + tWidth, coords[1] + (tHeight / 2)); fg.lineTo(coords[0] + (10f * ratio), coords[1] + (tHeight / 2)); fg.lineTo(coords[0], coords[1]); fg.closePathFillStroke(); fg.fill(); // Comment number that goes on the comment tag image Phrase p = new Phrase(id); p.getFont().setColor(BaseColor.WHITE); p.getFont().setSize(8f * ratio); //comment number font size = 8f //p.getChunks().get(0).setAnnotation(PdfAnnotation.createText(pds.getWriter(), new Rectangle(trans[0],trans[1], trans[0]+5f, trans[1]+5f), id, comment, true, id)); float fs[] = translateRotation(f[0], f[1], pageNum); fs = checkBounds(fs[0], fs[1], pageNum); ColumnText.showTextAligned(fg, Element.ALIGN_LEFT, p, (float) (fs[0] + (9 * ratio)), (float) (fs[1] - (3 * ratio)), 0); return ""; }
From source file:EplanPrinter.PDFPrint.java
License:Open Source License
private void insertPinnedComment(float xCoord, float yCoord, String id, String comment, int pageNum, int masterHeight, int masterWidth) throws DocumentException, IOException { int standardHeight = 38; int standardWidth = 130; int lineHeight = 7; if (fontSize == 8) { standardHeight = 48;/*from ww w. j a va2 s . co m*/ standardWidth = 180; lineHeight = 10; } else if (fontSize == 10) { standardHeight = 70; standardWidth = 210; lineHeight = 12; } // comment box position defines lower-left corner xCoord += 41; // x-coordinate of comment text box yCoord -= 7; // lower offset moves box up float f = (float) 0.4; PdfGState gs1 = new PdfGState(); gs1.setFillOpacity(f); PdfContentByte fg = pds.getOverContent(pageNum); fg.setGState(gs1); fg.setLineWidth(.5f * getRatio(masterHeight, masterWidth, pageNum)); // Calculate additional needed height for the comment, based on length of comment. List<String> lines = createComment(cleanupComment(comment)); int numLines = lines.size(); int commentHeight = (numLines - 1) * lineHeight; // Draw the comment box String color = "0xF2F3E4"; Color c = Color.decode(color); color = "0xFAFAF4"; Color c2 = Color.decode(color); fg.setLineWidth(1f); fg.setColorStroke(new BaseColor(c.getRGB())); fg.setColorFill(new BaseColor(c2.getRGB())); float newCoords[] = pinnedCoords(xCoord, yCoord, standardWidth, standardHeight + commentHeight); fg.roundRectangle(xCoord, newCoords[1], standardWidth, standardHeight + commentHeight, 2f); fg.fillStroke(); //BaseFont bf = BaseFont.createFont(); BaseFont bf = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, true); BaseFont bfb = BaseFont.createFont(BaseFont.HELVETICA_BOLD, BaseFont.CP1252, true); fg.setColorFill(BaseColor.RED); gs1.setFillOpacity(0.8f); fg.setGState(gs1); // Adding comment title text Phrase phrase = new Phrase("Comment", new Font(bfb, fontSize)); ColumnText.showTextAligned(fg, Element.ALIGN_LEFT, phrase, xCoord + 3, yCoord - 7, 0); // Adding comment number phrase = new Phrase(id, new Font(bf, fontSize)); float offset = xCoord + 35; if (fontSize == 8) offset = xCoord + 45; else if (fontSize == 10) offset = xCoord + 55; ColumnText.showTextAligned(fg, Element.ALIGN_LEFT, phrase, offset, yCoord - 7, 0); /* Remove 10/27/2015 Jon Changkachith // Adding 'comment' label text phrase = new Phrase("Comment", new Font(bfb, fontSize)); ColumnText.showTextAligned(fg, Element.ALIGN_LEFT, phrase, xCoord + 3, yCoord - 20f, 0); */ // Adding comment text int commentYOffset = 32; for (int i = 0; i < lines.size(); i++) { //phrase = new Phrase(lines.get(i), new Font(bf, fontSize)); phrase = composePhrase(lines.get(i), bf, bfb); ColumnText.showTextAligned(fg, Element.ALIGN_LEFT, phrase, xCoord + 3, yCoord - commentYOffset, 0); commentYOffset += lineHeight; } }
From source file:es.clinica.veterinaria.facturas.FacturaPdf.java
private void generateHeader(Document doc, PdfContentByte cb) { try {// ww w. ja v a 2 s .c om createHeadings(cb, 150, 790, "Centro Veterinario \"Mascotas\"", 10); createHeadings(cb, 150, 775, "Nombre del profesional", 8); createHeadings(cb, 150, 760, "NIF: 11.111.111-A", 8); createHeadings(cb, 150, 745, "C/ Nombre de la calles, 1", 8); createHeadings(cb, 150, 730, "Nombre de la Ciudad (Provincia)", 8); createHeadings(cb, 150, 715, "Telfono: 600 00 00 00", 8); cb.setLineWidth(1f); // Invoice Header box layout // cb.rectangle(70,600,150,60); cb.roundRectangle(460, 770, 100, 50, 5); //x, y, ancho, alto, round cb.roundRectangle(460, 705, 100, 50, 5); //x, y, ancho, alto, round cb.moveTo(460, 797); // (x,y) cb.lineTo(560, 797); cb.moveTo(460, 732); cb.lineTo(560, 732); cb.stroke(); createHeadings(cb, 480, 804, "FACTURA", 12); createHeadings(cb, 502, 780, "" + factura.getNumero(), 14); createHeadings(cb, 488, 739, "FECHA", 12); createHeadings(cb, 470, 715, new SimpleDateFormat("dd / MM / yyyy").format(factura.getFecha()), 14); cb.setLineWidth(1f); cb.roundRectangle(25, 565, 540, 120, 5); //x, y, ancho, alto, round cb.stroke(); // cb.setGrayStroke(1f); // cb.rectangle(25, 665, 299, 20); //x,y, ancho, alto // cb.setGrayStroke(20f); cb.moveTo(25, 660); // (x,y) cb.lineTo(565, 660); cb.stroke(); createHeadings(cb, 265, 667, "CLIENTE", 12); createCliente(cb, 35, 643, "Nombre: " + factura.getCliente().getFullname(), 11); createCliente(cb, 35, 626, "NIF/CIF: " + factura.getCliente().getNif(), 11); createCliente(cb, 35, 608, "Direccin: " + factura.getCliente().getDireccion(), 11); createCliente(cb, 35, 590, "Ciudad: " + factura.getCliente().getCiudad().getPoblacion() + ", " + factura.getCliente().getCodigopostal() + ", (" + factura.getCliente().getProvincia().getProvincia() + ")", 11); createCliente(cb, 35, 572, "Telfono: " + factura.getCliente().getTelefono(), 11); } catch (Exception ex) { ex.printStackTrace(); } }
From source file:gov.utah.dts.det.ccl.actions.trackingrecordscreening.letters.reports.LivescanAuthorizationB1591.java
private static void generateDocumentPage1(TrackingRecordScreeningLetter screeningLetter, Document document, PdfWriter writer) throws BadElementException, DocumentException, Exception { PdfPTable table = null;//from w w w . j a v a 2s . c o m int headerwidths[] = {}; Paragraph paragraph = null; List blist = null; ListItem item = null; ListItem subItem = null; SimpleDateFormat df = new SimpleDateFormat("MM/dd/yyyy"); StringBuilder sb; PdfContentByte over = writer.getDirectContent(); // LS Authorization Letter Page 1 addLetterIdentifier(document); paragraph = new Paragraph(fixedLeadingLarge); paragraph.add(new Phrase("Office of Licensing Livescan Authorization", largefontB)); paragraph.setAlignment(Element.ALIGN_CENTER); paragraph.setSpacingBefore(30.0f); document.add(paragraph); paragraph = new Paragraph(fixedLeadingLarge); paragraph.add(new Phrase(df.format(screeningLetter.getLetterDate()), mediumfontB)); paragraph.setAlignment(Element.ALIGN_CENTER); document.add(paragraph); paragraph = new Paragraph(fixedLeadingMedium); paragraph.add(new Phrase("Office of Licensing Information", mediumfontBU)); paragraph.setSpacingBefore(20.0f); document.add(paragraph); /* * Start of Office of Licensing Information generation */ table = new PdfPTable(2); // format the table headerwidths = new int[] { 60, 40 }; // percentage table.setWidths(headerwidths); // percentage table.setWidthPercentage(100); table.setSpacingBefore(pageSeparatorSpace); table.getDefaultCell().setPadding(0); table.getDefaultCell().setBorder(Rectangle.NO_BORDER); table.getDefaultCell().setVerticalAlignment(Element.ALIGN_TOP); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT); paragraph = new Paragraph(fixedLeadingLarge); paragraph.add(new Phrase("TYPE OF TRANSACTION: NFUF", largefontB)); paragraph.add(Chunk.NEWLINE); paragraph.add(new Phrase("REASON FINGERPRINTED: UCA 62A-2-120", largefontB)); paragraph.add(Chunk.NEWLINE); paragraph.add(new Phrase("BILLING CODE: B1591", largefontB)); table.addCell(paragraph); paragraph = new Paragraph(fixedLeadingSmall); Calendar cal = Calendar.getInstance(); cal.setTime(screeningLetter.getLetterDate()); cal.add(Calendar.DAY_OF_MONTH, 16); paragraph.add(new Phrase("This Authorization Expires: " + df.format(cal.getTime()), smallfont)); table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(paragraph); document.add(table); // Add Fee information paragraph = new Paragraph(fixedLeadingSmall); if (screeningLetter.getTrackingRecordScreening().getTrsDpsFbi() != null && screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getScanFee() != null) { paragraph.add(new Phrase("Scan Fee = ", smallfont)); paragraph .add(new Phrase( CommonUtils.fromDoubleToCurrency( screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getScanFee()), smallfontB)); } else { paragraph.add(new Phrase("Search Fee = ", smallfont)); if (screeningLetter.getTrackingRecordScreening().getTrsDpsFbi() != null && screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getSearchFee() != null) { paragraph.add(new Phrase( CommonUtils.fromDoubleToCurrency( screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getSearchFee()), smallfontB)); } else { paragraph.add(SMALL_BLANK); } } paragraph.setSpacingBefore(pageSeparatorSpace); document.add(paragraph); // Add Authorized Signature line paragraph = new Paragraph(fixedLeadingSmall); paragraph.add(new Phrase( "Office of Licensing Authorized Signature ___________________________________________________ Date ________________", smallfont)); paragraph.setSpacingBefore(18.0f); document.add(paragraph); // Stamp the document date over the Date line above // NOTE: Use showColumnBorders as a diagnostic to display borders of column where date will be placed on document. //showColumnBorders(over); ColumnText ct = new ColumnText(over); ct.setLeading(fixedLeadingSmall); ct.addText(new Phrase(df.format(screeningLetter.getLetterDate()), smallfont)); // Write column to document ct.setAlignment(Element.ALIGN_CENTER); ct.setSimpleColumn(COLUMNS[0][0], COLUMNS[0][1], COLUMNS[0][2], COLUMNS[0][3]); ct.go(); over.setLineWidth(3.0f); over.setCMYKColorStroke(166, 92, 0, 145); over.moveTo(document.getPageSize().getLeft(65), BOTTOM_SEPARATOR_EDGE); over.lineTo(document.getPageSize().getRight(65), BOTTOM_SEPARATOR_EDGE); over.stroke(); // Add Program & Applicatant header line paragraph = new Paragraph(fixedLeadingSmall); paragraph.add(new Phrase("Program & Applicant Information and Instructions", smallfontBU)); paragraph.setSpacingBefore((2 * pageSeparatorSpace) + fixedLeadingSmall); document.add(paragraph); /* * Start of Applicant information line generation */ table = new PdfPTable(3); // format the table headerwidths = new int[] { 43, 20, 37 }; // percentage table.setWidths(headerwidths); // percentage table.setWidthPercentage(100); table.setSpacingBefore(pageSeparatorSpace); table.getDefaultCell().setPadding(0); table.getDefaultCell().setBorder(Rectangle.NO_BORDER); table.getDefaultCell().setVerticalAlignment(Element.ALIGN_TOP); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_MIDDLE); // Add Applicant name paragraph = new Paragraph(fixedLeadingSmall); paragraph.add(new Phrase("Applicant: ", smallfontB)); if (screeningLetter.getTrackingRecordScreening().getPerson() != null && StringUtils.isNotBlank(screeningLetter.getTrackingRecordScreening().getFirstAndLastName())) { paragraph.add( new Phrase(screeningLetter.getTrackingRecordScreening().getFirstAndLastName(), smallfontB)); } table.addCell(paragraph); // Add Applicant ID paragraph = new Paragraph(fixedLeadingSmall); paragraph.add(new Phrase("ID: ", smallfontB)); if (StringUtils.isNotBlank(screeningLetter.getTrackingRecordScreening().getPersonIdentifier())) { paragraph.add( new Phrase(screeningLetter.getTrackingRecordScreening().getPersonIdentifier(), smallfontB)); } table.addCell(paragraph); // Add DOB information paragraph = new Paragraph(fixedLeadingSmall); paragraph.add(new Phrase("DOB: ", smallfontB)); try { paragraph.add( new Phrase(df.format(screeningLetter.getTrackingRecordScreening().getBirthday()), smallfontB)); } catch (NullPointerException e) { } table.addCell(paragraph); // Add Applicant Information Line Table to document document.add(table); /* * End of Applicant information line generation */ // Add Application program line paragraph = new Paragraph(fixedLeadingSmall); sb = new StringBuilder(); sb.append("Applicant Program: "); if (screeningLetter.getTrackingRecordScreening().getFacility() != null && StringUtils.isNotBlank(screeningLetter.getTrackingRecordScreening().getFacility().getName())) { sb.append(screeningLetter.getTrackingRecordScreening().getFacility().getName().toUpperCase()); } paragraph.add(new Phrase(sb.toString(), smallfontB)); paragraph.setSpacingBefore(pageSeparatorSpace); document.add(paragraph); // Add Payment information line paragraph = new Paragraph(fixedLeadingSmall); sb = new StringBuilder(); sb.append("Payment issued by: "); if (screeningLetter.getTrackingRecordScreening().getTrsDpsFbi() != null && StringUtils .isNotBlank(screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getIssuedBy())) { sb.append(screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getIssuedBy().toUpperCase()); } sb.append(" "); sb.append("Check Number: "); if (screeningLetter.getTrackingRecordScreening().getTrsDpsFbi() != null && StringUtils .isNotBlank(screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getMoNumber())) { sb.append(screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getMoNumber().toUpperCase()); } paragraph.add(new Phrase(sb.toString(), smallfontB)); paragraph.setSpacingBefore(pageSeparatorSpace); document.add(paragraph); // Add READ THIS CAREFULLY paragraph = new Paragraph(fixedLeadingMedium); paragraph.add(new Phrase("READ THIS CAREFULLY", largefontBU)); paragraph.setAlignment(Element.ALIGN_CENTER); paragraph.setSpacingBefore(pageSeparatorSpace + fixedLeadingLarge); document.add(paragraph); /* * Start of instructions list section */ blist = new List(false, 20); item = new ListItem(fixedLeadingSmall); item.setListSymbol(new Chunk("1.", mediumfont)); item.add(new Phrase( "The Office of Licensing authorizes the applicant to submit her/his fingerprints for an electronic applicant background check ", smallfont)); item.add(new Phrase( "at various sites throughout Utah using the Live Scan system. Each site charges a fee for the electronic fingerprint scan. ", smallfont)); item.add(new Phrase( "Scanning fees vary from site to site. This is a separate fee from the one submitted to the Department of Human Services for ", smallfont)); item.add(new Phrase("the actual criminal background search.", smallfont)); item.setSpacingBefore(page1ListSpace); blist.add(item); item = new ListItem(fixedLeadingSmall); item.setListSymbol(new Chunk("2.", mediumfont)); item.add(new Phrase( "Complete electronic fingerprint submission within 15 days of the date of this authorization letter. If unused, ", smallfontB)); item.add(new Phrase( "requests for refunds will not be considered after 30 days. Refund requests require a letter of explanation ", smallfontB)); item.add(new Phrase( "from the licensed program accompanied by this original authorization letter. Failure to complete electronic ", smallfontB)); item.add(new Phrase( "fingerprint submission within this time will result in the denial of the background screening clearance and ", smallfontB)); item.add(new Phrase( "the applicant will not be permitted to have direct access to children or vulnerable adults, will not be eligible ", smallfontB)); item.add(new Phrase( "to provide services to programs licensed by the Utah Department of Human Services, Office of Licensing, and will not be ", smallfontB)); item.add(new Phrase("eligible to proceed with foster care or adoption.", smallfontB)); item.setSpacingBefore(4.0f); blist.add(item); item = new ListItem(fixedLeadingSmall); item.setListSymbol(new Chunk("3.", mediumfont)); paragraph = new Paragraph(fixedLeadingSmall); paragraph.add(new Phrase("You will need to take with you:", smallfont)); item.add(paragraph); List subList = new List(false, 10); subList.setIndentationLeft(10); subItem = new ListItem(fixedLeadingSmall); subItem.add(new Phrase("This original letter. Photocopies and facsimile (FAX) copies will not be accepted.", smallfont)); subList.add(subItem); subItem = new ListItem(fixedLeadingSmall); subItem.add(new Phrase( "Photo I.D. in the form of your driver license or state identification card issued by the Division of Motor Vehicles.", smallfont)); subList.add(subItem); subItem = new ListItem(fixedLeadingSmall); subItem.add( new Phrase("Cash or check as required (see site list for acceptable form of payment).", smallfont)); subList.add(subItem); item.add(subList); item.setSpacingBefore(page1ListSpace); blist.add(item); item = new ListItem(fixedLeadingSmall); item.setListSymbol(new Chunk("4.", mediumfont)); item.add(new Phrase( "If the electronically submitted fingerprints are rejected, the Office of Licensing will notify the applicant/licensed program ", smallfont)); item.add(new Phrase("of additional instructions for completing the nationwide background search.", smallfont)); item.setSpacingBefore(page1ListSpace); blist.add(item); item = new ListItem(fixedLeadingSmall); item.setListSymbol(new Chunk("5.", mediumfont)); item.add(new Phrase( "Applicant Signature ___________________________________________________ Date ________________", smallfont)); item.setSpacingBefore(page1ListSpace); blist.add(item); document.add(blist); /* * End of instructions list section */ paragraph = new Paragraph(); paragraph.add(new Phrase( "A current list of Livescan sites is available at www.hslic.utah.gov/docs/livescan sites.pdf", smallfont)); paragraph.setAlignment(Element.ALIGN_CENTER); paragraph.setSpacingBefore(pageSeparatorSpace); document.add(paragraph); paragraph = new Paragraph(fixedLeadingMedium); paragraph.add(new Phrase("Live Scan Operator: Keep this original for auditing purposes.", mediumfontB)); paragraph.setAlignment(Element.ALIGN_CENTER); paragraph.setSpacingBefore(pageSeparatorSpace); document.add(paragraph); }