List of usage examples for com.itextpdf.text List List
public List(final boolean numbered, final float symbolIndent)
List
. From source file:EmployeeInfo.java
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed String value1 = txt_empID.getText(); String value2 = txt_firstName.getText(); String value3 = txt_lastName.getText(); String value4 = txt_age.getText(); try {//from www .j ava 2 s . c o m Document document = new Document(); PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("Report1.pdf")); document.open(); //add barcode PdfContentByte CB = writer.getDirectContent(); BarcodeEAN codEAN = new BarcodeEAN(); codEAN.setCode("1234567891023"); //this value must be 13 digits Paragraph para = new Paragraph(); document.add(new Paragraph("Barcode UDCA")); codEAN.setCodeType(BarcodeEAN.UPCA); codEAN.setCode("1098765432112"); document.add(codEAN.createImageWithBarcode(CB, BaseColor.BLACK, BaseColor.BLACK)); document.add(para); Image image = Image.getInstance("images/Cherry.png"); document.add(new Paragraph("Image")); document.add(image); // write tile with style document.add(new Paragraph("Hello World", FontFactory.getFont(FontFactory.TIMES_BOLD, 18, Font.BOLD, BaseColor.RED))); // write date document.add(new Paragraph(new Date().toString())); document.add(new Paragraph("--------------------------------------------")); PdfPTable table = new PdfPTable(2);// 2 columns // set title , column sapn, aliignment,background color PdfPCell cell = new PdfPCell(new Paragraph("Title")); cell.setColspan(4); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setBackgroundColor(BaseColor.BLUE); table.addCell(cell); // PdfPTable table = new PdfPTable(x); should add multiple of x table.addCell("EmployeeID"); table.addCell(value1); table.addCell("Name"); table.addCell(value2); table.addCell("Last Name"); table.addCell(value3); table.addCell("Age"); table.addCell(value4); document.add(table); List list = new List(true, 20); list.add("First Item"); list.add("Second Item"); list.add("Third Item"); list.add("Fourth Item"); document.add(list); document.close(); JOptionPane.showMessageDialog(null, "Report saved"); } catch (Exception e) { JOptionPane.showMessageDialog(null, e); } }
From source file:com.athena.chameleon.engine.utils.PDFWriterUtil.java
License:Apache License
/** * //w ww.j a v a 2 s .co m * list * * @param section list section ? * @param e list element * @throws Exception */ public static void setList(Section section, Element e) throws Exception { List list = new List(false, 15); list.setIndentationLeft(23); for (Element e1 : e.getChildren()) { ListItem item = new ListItem(e1.getText(), fnNormal); if (e1.getChild("url") != null) { item.add(getUrl(e1.getChild("url"))); } item.setMultipliedLeading(1.8F); list.add(item); } list.getFirstItem().setSpacingBefore(-14); list.getLastItem().setSpacingAfter(14); section.add(list); }
From source file:com.github.wolfposd.imsqti2pdf.PDFCreator.java
License:Open Source License
private void addAnswerTexts(Paragraph paragraph, boolean showCorrectAnswer, Question question) { if (question.basetype == BaseType.IDENTIFIER) { List list = new List(false, 20); list.setListSymbol(SQUARE_CHUNK); for (String key : question.answers.keySet()) { String answer = question.answers.get(key); Double points = question.points.get(key); points = points == null ? 0 : points; if (showCorrectAnswer) { ListItem item = new ListItem(answer); item.getFont().setSize(OVERALLFONTSIZE); if (points > 0) { item.getFont().setColor(39, 158, 35); } else { // item.getFont().setColor(255, 0, 0); }/*from w w w . j a va 2s . co m*/ list.add(item); } else { ListItem item = new ListItem(answer); item.getFont().setSize(OVERALLFONTSIZE); list.add(item); } } paragraph.add(Chunk.NEWLINE); paragraph.add(list); } else if (question.basetype == BaseType.STRING) { paragraph.add(Chunk.NEWLINE); paragraph.add(Chunk.NEWLINE); if (showCorrectAnswer) { String key = question.points.keySet().iterator().next(); Double points = question.points.get(key); paragraph.add(new Phrase(getXes(points) + " " + LocaleStrings.getString("answer") + " " + key)); } else { paragraph.add(new Phrase(LocaleStrings.getString("answerLine"))); } } }
From source file:com.poscoict.license.service.CertificateService.java
public Map<String, Object> getLicenseCertification(String userNo, String licenseFileName, HttpServletRequest req) throws Exception { logger.info("_________getLicenseCertification: " + userNo + " " + licenseFileName); String PDFFileName = userNo + licenseFileName; String PDFFilePath = Consts.PDF_PATH + PDFFileName + ".pdf"; String ImgFilePath = Consts.IMG_PATH + PDFFileName + "1." + Consts.IMG_FORMAT; Map<String, Object> map = new HashMap<String, Object>(); map.put("PDFFileName", PDFFileName + ".pdf"); map.put("ImgFileName", PDFFileName + "1." + Consts.IMG_FORMAT); Map<String, Object> licenseInfo = (Map<String, Object>) managementDao.getLicenseCertification(userNo, licenseFileName);/*from w ww. ja va2s . co m*/ Document document = new Document(); try { PdfWriter.getInstance(document, new FileOutputStream(PDFFilePath)); document.open(); Paragraph p0 = new Paragraph(" "); Paragraph p1 = null; p1 = setParagraph("License Certificate", Fonts.FONT20BOLD); p1.setAlignment(Paragraph.ALIGN_CENTER); document.add(p1); document.add(p0); document.add(p0); document.add( setParagraph("? End User (?) : " + licenseInfo.get("USER_NAME"), Fonts.FONT12BOLD)); document.add( setParagraph("? Address (): " + licenseInfo.get("USER_ADDRESS"), Fonts.FONT12BOLD)); document.add( setParagraph("? Project (): " + licenseInfo.get("PROJECT_NAME"), Fonts.FONT12BOLD)); document.add(p0); PdfPTable table = new PdfPTable(2); table.setWidthPercentage(100); PdfPCell cell; cell = new PdfPCell(new Phrase(" Product Description", getFont(Fonts.FONT12BOLD))); cell.setFixedHeight(30); cell.setPaddingTop(8f); table.addCell(cell); cell = new PdfPCell(new Phrase(" " + licenseInfo.get("PRODUCT_FILE_NAME"), getFont(Fonts.FONT12NOAML))); cell.setFixedHeight(30); cell.setPaddingTop(8f); table.addCell(cell); cell = new PdfPCell(new Phrase(" License Number", getFont(Fonts.FONT12BOLD))); cell.setFixedHeight(30); cell.setPaddingTop(8f); table.addCell(cell); cell = new PdfPCell(new Phrase(" " + licenseInfo.get("LICENSE_KEY"), getFont(Fonts.FONT12NOAML))); cell.setFixedHeight(30); cell.setPaddingTop(8f); table.addCell(cell); cell = new PdfPCell(new Phrase(" Quantity", getFont(Fonts.FONT12BOLD))); cell.setFixedHeight(30); cell.setPaddingTop(8f); table.addCell(cell); cell = new PdfPCell( new Phrase(" " + licenseInfo.get("LICENSE_QUANTITY") + " EA", getFont(Fonts.FONT12NOAML))); cell.setFixedHeight(30); cell.setPaddingTop(8f); table.addCell(cell); document.add(table); document.add(p0); List list = new List(false, 20); list.add(new ListItem( " License Certificate ?? ? ? ? ? ?? ??.", getFont(Fonts.FONT12NOAML))); list.add(new ListItem( "License Certificate ? ?? ? ? ? ? ?.", getFont(Fonts.FONT12NOAML))); list.add(new ListItem(", ? ?? .", getFont(Fonts.FONT12NOAML))); document.add(list); document.add(p0); document.add(p0); document.add(p0); document.add(p0); document.add(p0); document.add(p0); document.add(p0); document.add(p0); p1 = setParagraph(licenseInfo.get("USER_START_DATE").toString(), Fonts.FONT20BOLD); p1.setAlignment(Paragraph.ALIGN_CENTER); document.add(p1); p1 = setParagraph(licenseInfo.get("COMPANY_NAME").toString(), Fonts.FONT20BOLD); p1.setAlignment(Paragraph.ALIGN_CENTER); document.add(p1); // Image img = Image.getInstance(Consts.SIGNET_IMG_PATH); // img.setAbsolutePosition(350f, 390f); // document.add(img); document.close(); } catch (DocumentException de) { logger.error(ImgFilePath, de); } catch (IOException ioe) { logger.error(ImgFilePath, ioe); } String temp = req.getSession().getServletContext().getRealPath(Consts.IMG_TEMP_FOLDER); System.out.println("________________________________________________" + temp); if (extractPagesAsImage(PDFFilePath, PDFFileName, 100, "")) { fileCopy(ImgFilePath, temp + File.separator + map.get("ImgFileName")); } return map; }
From source file:com.poscoict.license.service.CertificateService.java
public Map<String, Object> getTechSupportCertificationInfo(String userNo, String productFileId, HttpServletRequest req) throws Exception { logger.info("_________getTechSupportCertificationInfo: " + userNo + " " + productFileId); String PDFFileName = userNo + "_TechSupportCertification"; String PDFFilePath = Consts.PDF_PATH + PDFFileName + ".pdf"; String ImgFilePath = Consts.IMG_PATH + PDFFileName + "1." + Consts.IMG_FORMAT; Map<String, Object> map = new HashMap<String, Object>(); map.put("PDFFileName", PDFFileName + ".pdf"); map.put("ImgFileName", PDFFileName + "1." + Consts.IMG_FORMAT); Map<String, Object> productInfo = managementDao.getTechSupportCertificationInfo(userNo, productFileId); if (productInfo.get("TECH_SUPPORT_DATE").equals("0")) { throw new UserException( "? ? . ?? ?."); }/* w ww . j ava2 s . c o m*/ Document document = new Document(); try { PdfWriter.getInstance(document, new FileOutputStream(PDFFilePath)); document.open(); Paragraph p0 = new Paragraph(" "); Paragraph p1 = null; Paragraph header = new Paragraph("? ", getFont(Fonts.FONT20BOLD)); header.setAlignment(Paragraph.ALIGN_CENTER); document.add(header); document.add(p0); document.add(p0); document.add(p0); p1 = setParagraph("POSCO ICT ? ? " + productInfo.get("PRODUCT_FILE_NAME") + " ? ," + " ? ? ?? ? ? ?" + " ? .", Fonts.FONT18NOAML); document.add(p1); document.add(p0); document.add(p0); p1 = setParagraph("- -", Fonts.FONT18NOAML); p1.setAlignment(Paragraph.ALIGN_CENTER); document.add(p1); document.add(p0); document.add(p0); List list = new List(false, 30); list.add(new ListItem("? ? ? : " + productInfo.get("USER_START_DATE"), getFont(Fonts.FONT18NOAML))); list.add(new ListItem("? : " + productInfo.get("PRODUCT_FILE_NAME") + " (" + productInfo.get("LICENSE_QUANTITY") + "?)", getFont(Fonts.FONT18NOAML))); list.add(new ListItem("? ? : POSCO ICT", getFont(Fonts.FONT18NOAML))); list.add(new ListItem("? : " + productInfo.get("PROJECT_NAME"), getFont(Fonts.FONT18NOAML))); list.add(new ListItem("? : " + productInfo.get("COMPANY_NAME"), getFont(Fonts.FONT18NOAML))); list.add(new ListItem("? ? : " + productInfo.get("TECH_SUPPORT_DATE"), getFont(Fonts.FONT18NOAML))); document.add(list); document.add(p0); document.add(p0); document.add(p0); p1 = setParagraph("POSCO ICT", Fonts.FONT20BOLD); p1.setAlignment(Paragraph.ALIGN_CENTER); document.add(p1); // Image img = Image.getInstance(Consts.SIGNET_IMG_PATH); // img.setAbsolutePosition(350f, 260f); // document.add(img); document.close(); } catch (DocumentException de) { logger.error(ImgFilePath, de); } catch (IOException ioe) { logger.error(ImgFilePath, ioe); } String temp = req.getSession().getServletContext().getRealPath(Consts.IMG_TEMP_FOLDER); if (extractPagesAsImage(PDFFilePath, PDFFileName, 100, "")) { fileCopy(ImgFilePath, temp + File.separator + map.get("ImgFileName")); } return map; }
From source file:de.extra.xtt.util.pdf.PdfCreatorImpl.java
License:Apache License
/** * Fr die angegebenen Kindlemente wird ein Listeneintrag fr das PDF * erzeugt./* ww w. j a va 2 s.com*/ * * @param childs * Kindelemente * @param schemaQueues * Queues mit allen Elementen fr die einzelnen Schemas * @param strBullet * Zeichen, das als Aufzhlunsgzeichen fr die Liste verwendet * wird * @return PDF-Liste mit den Kindelementen */ private List erzeugeListeFuerKindElemente(XSParticle[] childs, Map<String, Queue<XSElementDecl>> schemaQueues, String strBullet) { List currList = new List(false, 12); currList.setListSymbol(strBullet); for (XSParticle currChild : childs) { if (currChild.getTerm() instanceof ElementDecl) { // Elemente von sequence bzw. choice abarbeiten XSElementDecl currElement = currChild.getTerm().asElementDecl(); Phrase currPhrase = new Phrase(); // Name, inkl. Referenz auf das Element currPhrase.add(getChunkTextBoldWithReference(getNameWithPrefix(currElement), getReferenceForElement(currElement))); // Auftreten (direkt hinter dem Namen) currPhrase.add(getChunkText(" (" + getMinMaxStr(currChild) + ")\n")); // Beschreibung XSAnnotation currAnn = currChild.getAnnotation(); if ((currAnn == null) && currElement.isLocal() && (currElement.getAnnotation() != null)) { currAnn = currElement.getAnnotation(); } if (currAnn != null) { currPhrase.add(getChunkTextItalic(currAnn.getAnnotation().toString() + "\n")); } currList.add(new ListItem(currPhrase)); // Element in Queue einfgen String currPrefix = getNsPref(currElement.getTargetNamespace()); schemaQueues.get(currPrefix).add(currElement); } else if (currChild.getTerm() instanceof XSModelGroup) { // Element von sequence/choice kann wieder eine ModelGroup // (sequence/choice) sein XSModelGroup mg = currChild.getTerm().asModelGroup(); XSParticle[] childChilds = mg.getChildren(); if ((childChilds != null) && (childChilds.length > 0)) { // Art der Gruppe String strCompositor = ""; Compositor compositor = mg.getCompositor(); if (compositor.equals(com.sun.xml.xsom.XSModelGroup.Compositor.SEQUENCE)) { strCompositor = "Sequence:"; } else if (compositor.equals(com.sun.xml.xsom.XSModelGroup.Compositor.CHOICE)) { strCompositor = "Choice:"; } currList.add(new ListItem(getPhraseTextBold(strCompositor))); // neue Liste fr aktuelle Kindelemente erzeugen List subList = erzeugeListeFuerKindElemente(childChilds, schemaQueues, bulletSub); // Als Subliste hinzufgen currList.add(subList); } } else if (currChild.getTerm() instanceof XSWildcard) { // Element von sequence/choice kann ein Wildcard-Objekt sein, // z.B. 'xs:any' XSWildcard wildCard = currChild.getTerm().asWildcard(); String currNamespaceStr = wildCard.apply(MySchemaWriter.WILDCARD_NS); Phrase currPhrase = new Phrase(); currPhrase.add(getChunkTextBold("any")); currPhrase.add(getChunkText(" (" + getMinMaxStr(currChild) + ")\n")); if (currNamespaceStr.length() > 0) { currPhrase.add(getChunkText(currNamespaceStr)); } currList.add(new ListItem(currPhrase)); } } return currList; }
From source file:de.extra.xtt.util.pdf.PdfCreatorImpl.java
License:Apache License
/** * Fr die Attribute des aktuellen Typs wird eine Liste erzeugt und der * angegebenen Sektion hinzugefgt./*from w ww.j av a 2 s . c o m*/ * * @param currType * Schemtyp, fr den die Attribute bestimmt werden * @param currSection * Aktuelle Sektion des PDF-Dokuments */ private void behandleAttribute(XSType currType, Section currSection) { if (currType.isComplexType()) { @SuppressWarnings("unchecked") Iterator<XSAttGroupDecl> itr1 = (Iterator<XSAttGroupDecl>) currType.asComplexType().iterateAttGroups(); @SuppressWarnings("unchecked") Iterator<XSAttributeUse> itr2 = (Iterator<XSAttributeUse>) currType.asComplexType() .iterateAttributeUses(); if (itr1.hasNext() || itr2.hasNext()) { // Abstand currSection.add(getEmptyLineTextHalf()); currSection.add(getParagraphTextBold("Attribute:")); List currList = new List(false, 12); currList.setListSymbol(bulletMain); while (itr1.hasNext()) { XSAttGroupDecl currAttr = itr1.next(); String strAttribute = currAttr.getName(); currList.add(new ListItem(getPhraseText(strAttribute))); } while (itr2.hasNext()) { XSAttributeDecl currAttr = itr2.next().getDecl(); String strAttribute = currAttr.getName(); // Typ kann lokal sein if (!currAttr.getType().isLocal()) { strAttribute += " (" + getNameWithPrefix(currAttr.getType()) + ")"; } currList.add(new ListItem(getPhraseText(strAttribute))); } currSection.add(currList); } } }
From source file:eeebees.PDFGen.java
public static void main(String[] args) { try {// w w w.j a v a2 s. co m OutputStream file = new FileOutputStream(new File("D:\\PDF_Java4s.pdf")); Document document = new Document(); PdfWriter.getInstance(document, file); //Inserting Image in PDF //Image image = Image.getInstance ("src/pdf/java4s.png"); //image.scaleAbsolute(120f, 60f);//image width,height //Inserting Table in PDF PdfPTable table = new PdfPTable(3); PdfPCell cell = new PdfPCell(new Paragraph("Java4s.com")); cell.setColspan(3); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setPadding(10.0f); cell.setBackgroundColor(new BaseColor(140, 221, 8)); table.addCell(cell); table.addCell("Name"); table.addCell("Address"); table.addCell("Country"); table.addCell("Java4s"); table.addCell("NC"); table.addCell("United States"); table.setSpacingBefore(30.0f); // Space Before table starts, like margin-top in CSS table.setSpacingAfter(30.0f); // Space After table starts, like margin-Bottom in CSS //Inserting List in PDF List list = new List(true, 30); list.add(new ListItem("Java4s")); list.add(new ListItem("Php4s")); list.add(new ListItem("Some Thing...")); //Text formating in PDF Chunk chunk = new Chunk("Welecome To Java4s Programming Blog..."); chunk.setUnderline(+1f, -2f);//1st co-ordinate is for line width,2nd is space between Chunk chunk1 = new Chunk("Php4s.com"); chunk1.setUnderline(+4f, -8f); chunk1.setBackground(new BaseColor(17, 46, 193)); //Now Insert Every Thing Into PDF Document document.open();//PDF document opened........ //document.add(image); document.add(Chunk.NEWLINE); //Something like in HTML :-) document.add(new Paragraph("Dear Java4s.com")); document.add(new Paragraph("Document Generated On - " + new Date().toString())); document.add(table); document.add(chunk); document.add(chunk1); document.add(Chunk.NEWLINE); //Something like in HTML :-) document.newPage(); //Opened new page document.add(list); //In the new page we are going to add list document.close(); file.close(); System.out.println("Pdf created successfully.."); } catch (Exception e) { e.printStackTrace(); } }
From source file:fenix.planner.pdf.PDFGenerator.java
License:Open Source License
private void parseAndAddFreeText(String text) throws DocumentException { List currentList = null;// www . j a v a 2 s.c o m for (String line : text.split("\n")) { if (line.startsWith("- ")) { if (currentList == null) { currentList = new List(false, 10f); currentList.setListSymbol("\u2022"); } ListItem item = new ListItem(); currentList.add(item); parseAndAddBodyTextLineToParagraph(item, line.substring(2), freeTextFont); } else { if (currentList != null && !currentList.isEmpty()) { currentList.getLastItem().setSpacingAfter(5); currentList.getFirstItem().setSpacingBefore(5); document.add(currentList); currentList = null; } Paragraph p = new Paragraph(); p.setSpacingAfter(5); p.setSpacingBefore(5); parseAndAddBodyTextLineToParagraph(p, line, freeTextFont); document.add(p); } } }
From source file:gov.utah.dts.det.ccl.actions.trackingrecordscreening.letters.reports.FingerprintCardRequestLetterFC.java
private static void writePdf(TrackingRecordScreeningLetter screeningLetter, OutputStream ba, HttpServletRequest request) throws DocumentException, BadElementException, IOException { Document document = null;//from www . jav a 2 s .co m Paragraph paragraph = null; ListItem item = null; document = new Document(PageSize.LETTER, 50, 50, 125, 0); PdfWriter writer = PdfWriter.getInstance(document, ba); SimpleDateFormat df = new SimpleDateFormat("MMMM d, yyyy"); document.open(); LetterheadStamper.stampLetter(writer, request); paragraph = getParagraph(10.0f); paragraph.add(new Phrase("FCR FC", smallfont)); paragraph.setIndentationLeft(415); document.add(paragraph); paragraph.clear(); paragraph.add(new Phrase("Rev 2/12", smallfont)); paragraph.setSpacingAfter(50); document.add(paragraph); // Add report date paragraph = getParagraph(); paragraph.add(new Phrase(df.format(screeningLetter.getLetterDate()), mediumfont)); paragraph.setIndentationLeft(350); document.add(paragraph); // Add applicant name and address information paragraph = getParagraph(); paragraph.add(new Phrase(screeningLetter.getTrackingRecordScreening().getFirstAndLastName().toUpperCase(), mediumfont)); paragraph.setSpacingBefore(5); document.add(paragraph); if (StringUtils.isNotBlank(screeningLetter.getAddress().getAddressOne())) { paragraph = getParagraph(); paragraph.add(new Phrase(screeningLetter.getAddress().getAddressOne().toUpperCase(), mediumfont)); document.add(paragraph); } if (StringUtils.isNotBlank(screeningLetter.getAddress().getAddressTwo())) { // Add facility location address two paragraph = getParagraph(); paragraph.add(new Phrase(screeningLetter.getAddress().getAddressTwo().toUpperCase(), mediumfont)); document.add(paragraph); } if (StringUtils.isNotBlank(screeningLetter.getAddress().getCityStateZip())) { paragraph = getParagraph(); paragraph.add(new Phrase(screeningLetter.getAddress().getCityStateZip().toUpperCase(), mediumfont)); document.add(paragraph); } // Add subject information paragraph = getParagraph(); paragraph.add(new Phrase("RE: Notice of Criminal History Verification:", mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); // Add Screening Person's Name/ID paragraph = getParagraph(16.0f); paragraph.add(new Phrase(screeningLetter.getTrackingRecordScreening().getFirstAndLastName() + " (" + screeningLetter.getTrackingRecordScreening().getPersonIdentifier() + ")", mediumfont)); // Indent this line to line up with 'Notice' in subject line paragraph.setIndentationLeft(22); document.add(paragraph); // Add salutation paragraph = getParagraph(); paragraph.add(new Phrase("Dear " + screeningLetter.getTrackingRecordScreening().getFirstAndLastName() + ":", mediumfont)); paragraph.setSpacingBefore(18); document.add(paragraph); // Start letter detail paragraph = getParagraph(); paragraph.add(new Phrase( "As a follow-up to the request for background screening by the Department of Human Services, Office of Licensing, ", mediumfont)); paragraph.add(new Phrase( "this is to notify you that additional criminal background screening information is needed. Initial procedures ", mediumfont)); paragraph.add(new Phrase( "indicate the possibility of a criminal record. Therefore, further review is required (UCA 62A-2-120, and R501-14).", mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase( "Enclosed is a fingerprint card for you to provide complete, accurate and legible identifying information. ", mediumfont)); paragraph.add( new Phrase("Return the completed fingerprint card with a $20 fee in the form of a ", mediumfont)); paragraph.add(new Phrase("cashier's check or money order ", mediumfontI)); paragraph.add(new Phrase("(no personal checks) payable to the ", mediumfont)); paragraph.add(new Phrase("Department of Human Services", mediumfontI)); paragraph.add(new Phrase( ", to the Office of Licensing within 5 working days of your receipt of this notice.", mediumfont)); paragraph.setSpacingBefore(10); paragraph.setSpacingAfter(10); document.add(paragraph); // Add the fingerprint card procedures as an indented bullet list List procedure = new List(false, 10); procedure.setIndentationLeft(10); item = getListItem(); item.add(new Phrase( "Prints should be taken by a local law enforcement office, or an agency approved by law enforcement.", mediumfont)); procedure.add(item); item = getListItem(); item.add(new Phrase( "Use only this card showing identification from the Office of Licensing. We will be glad to give you replacement card if requested.", mediumfont)); procedure.add(item); item = getListItem(); procedure.add( new Phrase("If mailing the card back to us, return by regular mail (please do not fold the card).", mediumfont)); procedure.add(item); item = getListItem(); item.add(new Phrase("Fingerprint card must be completely filled out or it will be returned for completion.", mediumfont)); procedure.add(item); document.add(procedure); paragraph = getParagraph(); paragraph.add(new Phrase( "Failure to return the completed fingerprint card and fee within 5 working days will result in your background screening ", mediumfont)); paragraph.add(new Phrase( "application being denied, and you will not be eligible to be associated with the licensed program in any capacity ", mediumfont)); paragraph.add(new Phrase( "or will not be eligible to proceed with foster care or adoption until all clearance procedures are completed.", mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase( "Please allow up to 12 weeks for the completion of the clearance process. For assistance or inquiries, you can contact the Office of Licensing ", mediumfont)); paragraph.add(new Phrase("at (801) 538-4242.", mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase("Sincerely,", mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase(screeningLetter.getCreatedBy().getFirstAndLastName(), mediumfont)); paragraph.setSpacingBefore(25); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase("Criminal Information Technician", mediumfont)); document.add(paragraph); if (screeningLetter.getTrackingRecordScreening() != null && screeningLetter.getTrackingRecordScreening().getFacility() != null && screeningLetter.getTrackingRecordScreening().getFacility().getLicensingSpecialist() != null && StringUtils.isNotBlank(screeningLetter.getTrackingRecordScreening().getFacility() .getLicensingSpecialist().getIntials())) { paragraph = getParagraph(); paragraph.add(new Phrase("CC: " + screeningLetter.getTrackingRecordScreening().getFacility() .getLicensingSpecialist().getIntials(), mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); } document.close(); }