List of usage examples for com.itextpdf.text List add
public boolean add(final Element o)
Element
to the List
. From source file:eeebees.PDFGen.java
public static void main(String[] args) { try {/* w w w . j a v a 2s .c om*/ 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:eu.aniketos.wp1.ststool.report.pdfgenerator.ReportContentFactory.java
License:Open Source License
private void buildSectionAuthorisationFlow(Section section) { String sectionIntro = "In this section are described for each role/agent, the authorisations it passes to others and what authorisations it receives from other roles/agents."; section.add(createParagraph(sectionIntro)); List<Actor> selActor = getAuthorisationFlowActors(); List<com.itextpdf.text.List> lists = new ArrayList<com.itextpdf.text.List>(); for (Actor a : selActor) { StringBuilder sbOut = new StringBuilder(); for (Authorisation au : a.getOutgoingAuthorisations()) { if (isValidAuth(au)) { if (sbOut.length() > 0) sbOut.append(", and "); sbOut.append("authorises %i" + au.getTarget().getName() + "% to " + getOperations(au) + " information "); List<String> resList = new ArrayList<String>(); for (IResource r : au.getResources()) resList.add("%i" + r.getName() + "%"); sbOut.append(separateListOfString(resList) + ", "); List<String> goalList = new ArrayList<String>(); if (au.getGoals().size() > 0) { sbOut.append("in the scope of goal"); if (au.getGoals().size() > 1) sbOut.append("s"); // sbOut.append(" "); for (Goal g : au.getGoals()) { goalList.add("%i" + g.getName() + "%"); }//from ww w . jav a 2s . co m sbOut.append(" " + separateListOfString(goalList) + ", "); } if (au.getTimesTransferable() == 0) { sbOut.append("%iwithout% passing"); } else { sbOut.append("%ipassing%"); } sbOut.append(" the right to further authorising other actors"); String[] res = new String[resList.size()]; for (int i = 0; i < resList.size(); i++) res[i] = resList.get(i); String[] goals = new String[goalList.size()]; for (int i = 0; i < goalList.size(); i++) goals[i] = goalList.get(i); } } StringBuilder sbInc = new StringBuilder(); for (Authorisation au : a.getIncomingAuthorisations()) { if (isValidAuth(au)) { if (sbInc.length() > 0) sbInc.append(", and "); sbInc.append("is authorised by %i" + au.getSource().getName() + "% to " + getOperations(au) + " information "); List<String> resList = new ArrayList<String>(); for (IResource r : au.getResources()) resList.add("%i" + r.getName() + "%"); sbInc.append(separateListOfString(resList) + ", "); List<String> goalList = new ArrayList<String>(); if (au.getGoals().size() > 0) { sbInc.append("in the scope of goal"); if (au.getGoals().size() > 1) sbOut.append("s"); // sbInc.append(" "); for (Goal g : au.getGoals()) { goalList.add("%i" + g.getName() + "%"); } sbInc.append(" " + separateListOfString(goalList) + ", "); } if (au.getTimesTransferable() == 0) { sbInc.append("%iwithout% having"); } else { sbInc.append("%ihaving%"); } sbInc.append(" the right to further authorising other actors"); String[] res = new String[resList.size()]; for (int i = 0; i < resList.size(); i++) res[i] = resList.get(i); String[] goals = new String[goalList.size()]; for (int i = 0; i < goalList.size(); i++) goals[i] = goalList.get(i); } } if (sbOut.length() > 0 || sbInc.length() > 0) { String type = "%iAgent% "; if (a instanceof Role) type = "%iRole% "; Paragraph actorName = createParagraph(type + "%b" + a.getName() + "%:"); actorName.setSpacingAfter(5); com.itextpdf.text.List list = new com.itextpdf.text.List(com.itextpdf.text.List.UNORDERED); list.setListSymbol("\u2022" + " "); list.setSymbolIndent(10f); list.add(new ListItem(actorName)); if (sbOut.length() > 0) { com.itextpdf.text.List sublist = new com.itextpdf.text.List(com.itextpdf.text.List.UNORDERED); sublist.setListSymbol("- "); sublist.setSymbolIndent(30f); // Paragraph p=createParagraph("%b" + a.getName() + "% " + // sbOut.toString() + "."); Paragraph p = createParagraph(sbOut.toString() + "."); if (sbInc.length() > 0) { p.setSpacingAfter(10); } sublist.add(new ListItem(p)); list.add(sublist); } if (sbInc.length() > 0) { com.itextpdf.text.List sublist = new com.itextpdf.text.List(com.itextpdf.text.List.UNORDERED); sublist.setListSymbol("- "); sublist.setSymbolIndent(30f); // Paragraph p=createParagraph("%b" + a.getName() + "% " + // sbInc.toString() + "."); Paragraph p = createParagraph(sbInc.toString() + "."); sublist.add(new ListItem(p)); list.add(sublist); } lists.add(list); } } if (lists.size() > 0) { String s = "In the " + getProjectName() + " project" + autDiagRef() + " the authorisations for each role/agent are:"; section.add(createParagraph(s)); for (com.itextpdf.text.List list : lists) { section.add(list); } } else { section.add(createParagraph("In the " + getProjectName() + " project there are no authorisation taking place for the given agents/roles.")); } section.setComplete(true); }
From source file:eu.aniketos.wp1.ststool.report.pdfgenerator.ReportContentFactory.java
License:Open Source License
private void buildAppendixCChapter(Chapter c, Document d) { c.setTitle(getChapterTitleParagraph("Appendix C")); c.setNumberDepth(0);/*from w w w. j a v a 2 s. co m*/ c.setTriggerNewPage(true); String sectionIntro = "STS-ml allows for the specification of security needs over actors interactions. It currently supports a non-exhaustive set of security needs and organisational constraints, namely non-repudiation, redundancy, no-delegation, non-usage, non-modification, non-production, non-disclosure and need-to-know. The purpose of security analysis is to verify whether there are any violations of security needs. As such, it includes defining the rules necessary to detect violations. In the following are provided the details for all the checks performed during security analysis."; c.add(createParagraph(sectionIntro)); List<Paragraph> plist = new ArrayList<Paragraph>(); int kk = 0; for (kk = kk; kk < 4; kk++) { plist.add(getSecurityAnalysisDescription(SecurityAnalysisTasksNames.ALL_TASKS_NAMES[kk])); } c.add(listParagraphs(plist)); plist.clear(); Paragraph parList = getDefaultParagraph(); com.itextpdf.text.List list = new com.itextpdf.text.List(com.itextpdf.text.List.UNORDERED); list.setListSymbol("\u2022" + " "); list.setSymbolIndent(30f); parList.add(list); parList.setSpacingBefore(0f); parList.setSpacingAfter(0f); list.add(new ListItem(getSecurityAnalysisDescription(SecurityAnalysisTasksNames.ALL_TASKS_NAMES[kk++]))); com.itextpdf.text.List subList = new com.itextpdf.text.List(com.itextpdf.text.List.UNORDERED); subList.setListSymbol("\u2022" + " "); subList.setSymbolIndent(15f); for (kk = kk; kk < 10; kk++) { subList.add( new ListItem(getSecurityAnalysisDescription(SecurityAnalysisTasksNames.ALL_TASKS_NAMES[kk]))); // plist.add(getSecurityAnalysisDescription(SecurityAnalysisTasksNames.ALL_TASKS_NAMES[kk])); } list.add(subList); c.add(parList); /* * Paragraph actorName = createParagraph(type + "%b" + a.getName() + * "%:"); actorName.setSpacingAfter(5); * * com.itextpdf.text.List list = new * com.itextpdf.text.List(com.itextpdf.text.List.UNORDERED); * list.setListSymbol("\u2022" + " "); list.setSymbolIndent(10f); * list.add(new ListItem(actorName)); * * if (sbOut.length() > 0) { com.itextpdf.text.List sublist = new * com.itextpdf.text.List(com.itextpdf.text.List.UNORDERED); * sublist.setListSymbol("- "); sublist.setSymbolIndent(30f); * //Paragraph p=createParagraph("%b" + a.getName() + "% " + * sbOut.toString() + "."); Paragraph p = * createParagraph(sbOut.toString() + "."); * * if (sbInc.length() > 0) { p.setSpacingAfter(10); } * * sublist.add(new ListItem(p)); list.add(sublist); */ String text = "Apart from the verification of violations of security needs, security analysis performs checks to verify that actors comply with their authorities. For this, it searches for eventual unauthorised passages of rights. For the time being, the following violations are detected:"; c.add(createParagraph(text)); parList = getDefaultParagraph(); list = new com.itextpdf.text.List(com.itextpdf.text.List.UNORDERED); list.setListSymbol("\u2022" + " "); list.setSymbolIndent(30f); parList.add(list); parList.setSpacingBefore(0f); parList.setSpacingAfter(0f); list.add(new ListItem(getSecurityAnalysisDescription(SecurityAnalysisTasksNames.ALL_TASKS_NAMES[kk++]))); subList = new com.itextpdf.text.List(com.itextpdf.text.List.UNORDERED); subList.setListSymbol("\u2022" + " "); subList.setSymbolIndent(15f); for (kk = kk; kk < 16; kk++) { subList.add( new ListItem(getSecurityAnalysisDescription(SecurityAnalysisTasksNames.ALL_TASKS_NAMES[kk]))); // plist.add(getSecurityAnalysisDescription(SecurityAnalysisTasksNames.ALL_TASKS_NAMES[kk])); } list.add(subList); c.add(parList); text = "As far as organisational constraints are concerned, security analysis verifies that the specification of SoD and BoD constraints can be satisfied in the given model. The satisfaction of role-based SoD and BoD are already covered by the consistency analysis, security analysis deals with goal-based SoD and BoD instead."; c.add(createParagraph(text)); for (kk = kk; kk < SecurityAnalysisTasksNames.ALL_TASKS_NAMES.length; kk++) { plist.add(getSecurityAnalysisDescription(SecurityAnalysisTasksNames.ALL_TASKS_NAMES[kk])); } c.add(listParagraphs(plist)); c.setComplete(true); }
From source file:fenix.planner.pdf.PDFGenerator.java
License:Open Source License
private void parseAndAddFreeText(String text) throws DocumentException { List currentList = null; for (String line : text.split("\n")) { if (line.startsWith("- ")) { if (currentList == null) { currentList = new List(false, 10f); currentList.setListSymbol("\u2022"); }//from w ww . j a v a 2 s.c om 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:generadorPDF.generarPDF.java
private static void createList(Section subCatPart) { List list = new List(true, false, 10); list.add(new ListItem("First point")); list.add(new ListItem("Second point")); list.add(new ListItem("Third point")); subCatPart.add(list);//from w ww. ja va2s.c om }
From source file:gov.utah.dts.det.ccl.actions.reports.generators.LicenseRenewalLettersReport.java
private static void generateDocumentPage(FacilityLicenseView license, Date today, Document document, PdfWriter writer) throws BadElementException, DocumentException, Exception { PdfPTable table = null;// w w w. j a va 2 s .co m int headerwidths[] = {}; Paragraph paragraph = null; com.itextpdf.text.List blist = null; com.itextpdf.text.List subList = null; ListItem item = null; ListItem subItem = null; StringBuilder sb; PdfContentByte over = writer.getDirectContent(); Facility facility = license.getFacility(); Person licensingSpecialist = null; if (facility != null && facility.getLicensingSpecialist() != null) { licensingSpecialist = facility.getLicensingSpecialist(); } // Add report date paragraph = new Paragraph(fixedLeading); paragraph.add(new Phrase(df.format(today), mediumfont)); paragraph.setIndentationLeft(dateIndent); document.add(paragraph); // Add facility information paragraph = new Paragraph(fixedLeading); if (facility != null && StringUtils.isNotBlank(facility.getName())) { paragraph.add(new Phrase(facility.getName(), mediumfont)); } else { paragraph.add(BLANK); } if (facility != null && facility.getMailingAddress() != null && StringUtils.isNotBlank(facility.getMailingAddress().getAddressOne())) { paragraph.add(Chunk.NEWLINE); paragraph.add(new Phrase(facility.getMailingAddress().getAddressOne(), mediumfont)); if (StringUtils.isNotBlank(facility.getMailingAddress().getAddressTwo())) { paragraph.add(Chunk.NEWLINE); paragraph.add(new Phrase(facility.getMailingAddress().getAddressTwo(), mediumfont)); } if (StringUtils.isNotBlank(facility.getMailingAddress().getCityStateZip())) { paragraph.add(Chunk.NEWLINE); paragraph.add(new Phrase(facility.getMailingAddress().getCityStateZip(), mediumfont)); } } paragraph.setSpacingBefore(15); document.add(paragraph); // Add salutation paragraph = new Paragraph(fixedLeading); sb = new StringBuilder(); sb.append("Dear "); if (StringUtils.isNotBlank(facility.getName())) { sb.append(facility.getName()); } paragraph.add(new Phrase(sb.toString(), mediumfont)); paragraph.setSpacingBefore(pageSeparatorSpace); document.add(paragraph); // Add due for renewal line paragraph = new Paragraph(fixedLeading); paragraph.add(new Phrase( "Your foster care license is due for renewal on " + df.format(license.getExpirationDate()), mediumfontB)); paragraph.setSpacingBefore(pageSeparatorSpace); document.add(paragraph); // Add first paragraph paragraph = new Paragraph(fixedLeading); sb = new StringBuilder(); sb.append( "The Office of Licensing appreciates the services you have provided for DCFS and to the foster children "); sb.append( "who have been in your care. We hope that you will continue as foster parents for the next year. "); sb.append("To continue licensing please complete the following:"); paragraph.add(new Phrase(sb.toString(), mediumfont)); paragraph.setSpacingBefore(pageSeparatorSpace); paragraph.setSpacingAfter(pageSeparatorSpace); document.add(paragraph); /* * Start of instructions list section */ blist = new com.itextpdf.text.List(false, 20); item = new ListItem(fixedLeading); item.setListSymbol(new Chunk("1.", mediumfont)); item.add(new Phrase("Complete the enclosed Renewal Resource Family Application.", mediumfont)); item.setSpacingAfter(listSpace); blist.add(item); item = new ListItem(fixedLeading); item.setListSymbol(new Chunk("2.", mediumfont)); sb = new StringBuilder(); sb.append( "Complete the Utah Department of Human Services Office of Licensing Background Screening Application form for everyone "); sb.append("18 years of age and older living in the home. Each form must have an original signature."); item.add(new Phrase(sb.toString(), mediumfont)); item.setSpacingAfter(listSpace); blist.add(item); item = new ListItem(fixedLeading); item.setListSymbol(new Chunk("3.", mediumfont)); paragraph = new Paragraph(fixedLeading); paragraph.add( new Phrase("For everyone 18 years of age or older living in the home please attach:", mediumfont)); item.add(paragraph); subList = new com.itextpdf.text.List(false, 18); subList.setIndentationLeft(10); subItem = new ListItem(fixedLeading); subItem.setListSymbol(new Chunk("(a)", mediumfontB)); subItem.add( new Phrase("A legible copy of a current drivers license or a Utah State I.D. card.", mediumfontB)); subList.add(subItem); subItem = new ListItem(fixedLeading); subItem.setListSymbol(new Chunk("(b)", mediumfontB)); subItem.add(new Phrase("A legible copy of their social security card.", mediumfontB)); subList.add(subItem); item.add(subList); item.setSpacingAfter(listSpace); blist.add(item); item = new ListItem(fixedLeading); item.setListSymbol(new Chunk("4.", mediumfont)); item.add(new Phrase("Complete the enclosed Foster Care Renewal Information Form.", mediumfont)); item.setSpacingAfter(listSpace); blist.add(item); item = new ListItem(fixedLeading); item.setListSymbol(new Chunk("5.", mediumfont)); item.add(new Phrase("Provide copies of income verification (check stubs/or last year's income tax forms.)", mediumfontB)); item.setSpacingAfter(listSpace); blist.add(item); item = new ListItem(fixedLeading); item.setListSymbol(new Chunk("6.", mediumfont)); item.add(new Phrase("All paperwork must be returned 30 days before your license expires to:", mediumfontB)); subList = new com.itextpdf.text.List(false, 0); subList.setListSymbol(new Chunk(" ", mediumfont)); subList.setIndentationLeft(10); subItem = new ListItem(fixedLeading); subItem.add(new Phrase("Office of Licensing", mediumfont)); subItem.setSpacingBefore(listItemSpace); subList.add(subItem); subItem = new ListItem(fixedLeading); if (licensingSpecialist != null && StringUtils.isNotBlank(licensingSpecialist.getFirstAndLastName())) { subItem.add(new Phrase(licensingSpecialist.getFirstAndLastName(), mediumfont)); } else { subItem.add(new Phrase("<Facility Licensing Specialist>", mediumfont)); } subList.add(subItem); if (licensingSpecialist != null && licensingSpecialist.getAddress() != null && StringUtils.isNotBlank(licensingSpecialist.getAddress().getAddressOne())) { subItem = new ListItem(fixedLeading); subItem.add(new Phrase(licensingSpecialist.getAddress().getAddressOne(), mediumfont)); subList.add(subItem); } if (licensingSpecialist != null && licensingSpecialist.getAddress() != null && StringUtils.isNotBlank(licensingSpecialist.getAddress().getAddressTwo())) { subItem = new ListItem(fixedLeading); subItem.add(new Phrase(licensingSpecialist.getAddress().getAddressTwo(), mediumfont)); subList.add(subItem); } if (licensingSpecialist != null && licensingSpecialist.getAddress() != null && StringUtils.isNotBlank(licensingSpecialist.getAddress().getCityStateZip())) { subItem = new ListItem(fixedLeading); subItem.add(new Phrase(licensingSpecialist.getAddress().getCityStateZip(), mediumfont)); subList.add(subItem); } item.add(subList); item.setSpacingAfter(listSpace); blist.add(item); item = new ListItem(fixedLeading); item.setListSymbol(new Chunk("7.", mediumfont)); item.add(new Phrase( "Please call and schedule an appointment with me for your annual health and safety check.", mediumfont)); item.setSpacingAfter(listSpace); blist.add(item); item = new ListItem(fixedLeading); item.setListSymbol(new Chunk("8.", mediumfont)); paragraph = new Paragraph(fixedLeading); sb = new StringBuilder(); sb.append( "Complete the DCFS required renewal training of 12 hours for the primary provider and 4 hours for a spouse "); sb.append( "before your license expires. Please send all training to be approved and documented to the Utah Foster Care Foundation."); paragraph.add(new Phrase(sb.toString(), mediumfont)); item.add(paragraph); paragraph = new Paragraph(fixedLeading); sb = new StringBuilder(); sb.append( "The Utah Foster Care Foundation will then provide verification of all completed required training "); sb.append("to your local licensor."); paragraph.add(new Phrase(sb.toString(), mediumfontB)); item.add(paragraph); blist.add(item); document.add(blist); /* * End of instructions list section */ // Add final paragraph paragraph = new Paragraph(fixedLeading); paragraph.setSpacingBefore(pageSeparatorSpace); paragraph.add(new Phrase( "Your license will expire if all renewal requirements are not completed by the end of the licensing month. ", mediumfont)); paragraph.add(new Phrase( "A license expired beyond 30 days will require initiation of the background screening process again (including ", mediumfontB)); paragraph.add(new Phrase("any necessary fingerprinting). ", mediumfontB)); paragraph.add(new Phrase( "If you choose to discontinue providing services or have any questions, please contact me at ", mediumfont)); if (licensingSpecialist.getWorkPhone() != null && StringUtils.isNotBlank(licensingSpecialist.getWorkPhone().getFormattedPhoneNumber())) { paragraph.add(new Phrase(licensingSpecialist.getWorkPhone().getFormattedPhoneNumber(), mediumfontB)); } paragraph.add(new Phrase(".", mediumfontB)); document.add(paragraph); // Add closing paragraph = new Paragraph(fixedLeading); paragraph.setIndentationLeft(rightIndent); paragraph.setSpacingBefore(2 * pageSeparatorSpace); paragraph.add(new Phrase("Sincerely,", mediumfont)); document.add(paragraph); paragraph = new Paragraph(fixedLeading); paragraph.setIndentationLeft(rightIndent); paragraph.setSpacingBefore(3 * pageSeparatorSpace); if (licensingSpecialist != null && StringUtils.isNotBlank(licensingSpecialist.getFirstAndLastName())) { paragraph.add(new Phrase(licensingSpecialist.getFirstAndLastName(), mediumfont)); } else { paragraph.add(new Phrase("<Facility Licensing Specialist>", mediumfont)); } paragraph.add(Chunk.NEWLINE); paragraph.add(new Phrase("Foster Family Licensing Specialist", mediumfont)); document.add(paragraph); // Add Enclosures paragraph = new Paragraph(fixedLeading); paragraph.setSpacingBefore(pageSeparatorSpace); paragraph.add(new Phrase("Enclosures", mediumfont)); paragraph.add(Chunk.NEWLINE); paragraph.add(new Phrase("cc: Provider Record", mediumfont)); document.add(paragraph); }
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 w w w . j a va 2s .c o 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(); }
From source file:gov.utah.dts.det.ccl.actions.trackingrecordscreening.letters.reports.FingerprintCardRequestLetterTX.java
private static void writePdf(TrackingRecordScreeningLetter screeningLetter, OutputStream ba, HttpServletRequest request) throws DocumentException, BadElementException, IOException { Document document = null;/*from w ww .java 2s. c om*/ 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 TX", 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 facility name and address information paragraph = getParagraph(); paragraph.add(new Phrase(screeningLetter.getTrackingRecordScreening().getFacility().getName().toUpperCase(), mediumfont)); paragraph.setSpacingBefore(5); document.add(paragraph); if (screeningLetter.getTrackingRecordScreening().getFacility().getCbsAddress() != null) { if (StringUtils.isNotBlank( screeningLetter.getTrackingRecordScreening().getFacility().getCbsAddress().getAddressOne())) { paragraph = getParagraph(); paragraph.add(new Phrase(screeningLetter.getTrackingRecordScreening().getFacility().getCbsAddress() .getAddressOne().toUpperCase(), mediumfont)); document.add(paragraph); } if (StringUtils.isNotBlank( screeningLetter.getTrackingRecordScreening().getFacility().getCbsAddress().getAddressTwo())) { // Add facility location address two paragraph = getParagraph(); paragraph.add(new Phrase(screeningLetter.getTrackingRecordScreening().getFacility().getCbsAddress() .getAddressTwo().toUpperCase(), mediumfont)); document.add(paragraph); } if (StringUtils.isNotBlank( screeningLetter.getTrackingRecordScreening().getFacility().getCbsAddress().getCityStateZip())) { paragraph = getParagraph(); paragraph.add(new Phrase(screeningLetter.getTrackingRecordScreening().getFacility().getCbsAddress() .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 Director:", 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 the applicant 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(22); 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 a replacement card if requested.", mediumfont)); procedure.add(item); item = getListItem(); item.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 the background screening ", mediumfont)); paragraph.add(new Phrase( "application being denied, and the applicant 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, please contact the Office of Licensing ", mediumfont)); paragraph.add(new Phrase("at (801) 538-4242.", mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); paragraph = new Paragraph("Sincerely,", mediumfont); paragraph.setSpacingBefore(10); document.add(paragraph); paragraph = new Paragraph(screeningLetter.getCreatedBy().getFirstAndLastName(), mediumfont); paragraph.setSpacingBefore(25); document.add(paragraph); paragraph = new Paragraph("Criminal Information Technician", mediumfont); document.add(paragraph); document.close(); }
From source file:gov.utah.dts.det.ccl.actions.trackingrecordscreening.letters.reports.LivescanAuthorization.java
private static void generateDocumentPage1(TrackingRecordScreeningLetter screeningLetter, Document document, PdfWriter writer) throws BadElementException, DocumentException, Exception { PdfPTable table = null;// www . java 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"); // LS Authorization Letter Page 1 addLetterIdentifier(screeningLetter, document); paragraph = new Paragraph(fixedLeadingLarge); paragraph.add(new Phrase("Office of Licensing Authorization", largefontB)); paragraph.setAlignment(Element.ALIGN_CENTER); document.add(paragraph); paragraph = new Paragraph(fixedLeadingLarge); paragraph.add(new Phrase("for Electronic Background Check", largefontB)); paragraph.setAlignment(Element.ALIGN_CENTER); 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", mediumfontU)); paragraph.setSpacingBefore(page1SeparatorSpace); document.add(paragraph); paragraph = new Paragraph(fixedLeadingSmall); paragraph.add(new Phrase("Type of Background Check Required and Agency Billing Code:", smallfont)); paragraph.setSpacingBefore(page1SeparatorSpace); document.add(paragraph); /* * Start of Billing information line generation */ table = new PdfPTable(3); // format the table headerwidths = new int[] { 20, 45, 35 }; // percentage table.setWidths(headerwidths); // percentage table.setWidthPercentage(100); table.setSpacingBefore(page1SeparatorSpace); table.getDefaultCell().setPadding(0); table.getDefaultCell().setBorder(Rectangle.NO_BORDER); table.getDefaultCell().setVerticalAlignment(Element.ALIGN_TOP); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT); // Add Billing Code if (screeningLetter.getTrackingRecordScreening().getTrsDpsFbi() != null && screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getBilling() != null && StringUtils.isNotBlank( screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getBilling().getValue())) { table.addCell( new Phrase(screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getBilling().getValue(), xlargefontB)); } else { table.addCell(new Phrase(" ", xlargefontB)); } // Add Fee information paragraph = new Paragraph(fixedLeadingSmall); 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.add(new Phrase(" / Scan Fee = ", smallfont)); if (screeningLetter.getTrackingRecordScreening().getTrsDpsFbi() != null && screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getScanFee() != null) { paragraph .add(new Phrase( CommonUtils.fromDoubleToCurrency( screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getScanFee()), smallfontB)); } table.addCell(paragraph); // Add Facility Type information table.addCell(new Phrase("Licensed Treatment Programs", smallfont)); // Add Billing Information Line Table to document document.add(table); /* * End of Billing information line table generation */ // Add Check Number document line paragraph = new Paragraph(fixedLeadingSmall); paragraph.add(new Phrase("Check Number ", smallfont)); if (screeningLetter.getTrackingRecordScreening().getTrsDpsFbi() != null && StringUtils .isNotBlank(screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getMoNumber())) { paragraph.add(new Phrase(screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getMoNumber(), smallfontB)); } paragraph.setSpacingBefore(page1SeparatorSpace); document.add(paragraph); /* * Start of Check Issuer information line */ table = new PdfPTable(2); // format the table headerwidths = new int[] { 40, 60 }; // percentage table.setWidths(headerwidths); // percentage table.setWidthPercentage(100); table.setSpacingBefore(page1SeparatorSpace); table.getDefaultCell().setPadding(0); table.getDefaultCell().setBorder(Rectangle.NO_BORDER); table.getDefaultCell().setVerticalAlignment(Element.ALIGN_TOP); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT); // Add Issuer information paragraph = new Paragraph(fixedLeadingSmall); paragraph.add(new Phrase("Issuer ", smallfont)); if (screeningLetter.getTrackingRecordScreening().getTrsDpsFbi() != null && StringUtils .isNotBlank(screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getIssuedBy())) { paragraph.add(new Phrase(screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getIssuedBy(), smallfontB)); } table.addCell(paragraph); // Add Program Name information paragraph = new Paragraph(fixedLeadingSmall); paragraph.add(new Phrase("Program Name ", smallfont)); if (screeningLetter.getTrackingRecordScreening().getFacility() != null && StringUtils.isNotBlank(screeningLetter.getTrackingRecordScreening().getFacility().getName())) { paragraph.add( new Phrase(screeningLetter.getTrackingRecordScreening().getFacility().getName(), smallfontB)); } table.addCell(paragraph); // Add the Check Issuer table to the document document.add(table); /* * End of Check Issuer information line */ /* * 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(page1SeparatorSpace); 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 ", smallfont)); 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 ", smallfont)); 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 ", smallfont)); 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 Facility Licensing Specialist Information paragraph = new Paragraph(fixedLeadingSmall); paragraph.add(new Phrase("OL Representative ", smallfont)); if (screeningLetter.getTrackingRecordScreening().getFacility() != null && screeningLetter.getTrackingRecordScreening().getFacility().getLicensingSpecialist() != null && StringUtils.isNotBlank(screeningLetter.getTrackingRecordScreening().getFacility() .getLicensingSpecialist().getFirstAndLastName())) { paragraph.add(new Phrase(screeningLetter.getTrackingRecordScreening().getFacility() .getLicensingSpecialist().getFirstAndLastName(), smallfontB)); } paragraph.setSpacingBefore(page1SeparatorSpace); document.add(paragraph); // Add Distribution Line paragraph = new Paragraph(fixedLeadingSmall); paragraph.add(new Phrase( "Distribution: Original for the Applicant to turn in to the Live Scan Operator. Copy retained by Office of Licensing.", smallfont)); paragraph.setSpacingBefore(page1SeparatorSpace); document.add(paragraph); // Add Program & Applicatant header line paragraph = new Paragraph(fixedLeadingSmall); paragraph.add(new Phrase("Program & Applicant Information and Instructions", smallfontBU)); paragraph.setSpacingBefore(page1SeparatorSpace); document.add(paragraph); // Add READ THIS CAREFULLY paragraph = new Paragraph(fixedLeadingMedium); paragraph.add(new Phrase("READ THIS CAREFULLY", mediumfontB)); paragraph.setAlignment(Element.ALIGN_CENTER); paragraph.setSpacingBefore(page1SeparatorSpace); 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. Please see the enclosed list for site information. Each site ", smallfont)); item.add(new Phrase( "charges a fee for the electronic fingerprint scan. Scanning fees vary from site to site. This is a separate fee from the ", smallfont)); item.add(new Phrase( "one submitted to the Department of Human Services for 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. ", smallfontB)); item.setSpacingBefore(page1ListSpace); blist.add(item); item = new ListItem(fixedLeadingSmall); item.setListSymbol(new Chunk("", smallfont)); item.add(new Phrase( "Refund requests require a letter of explanation from the licensed program accompanied by this original authorization letter.", smallfontBU)); item.setSpacingBefore(4.0f); blist.add(item); item = new ListItem(fixedLeadingSmall); item.setListSymbol(new Chunk("", smallfont)); item.add(new Phrase( "Failure to complete electronic fingerprint submission within this time will result in the denial of the background screening ", smallfontB)); item.add(new Phrase( "clearance and 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 identification 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("Social Security Card", 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("Legibly print the following information for the scanning operator:", smallfont)); item.setSpacingBefore(page1ListSpace); blist.add(item); document.add(blist); document.add(getPage1WriteInLine1()); document.add(getPage1WriteInLine2()); document.add(getPage1WriteInLine3()); blist = new List(false, 20); item = new ListItem(fixedLeadingSmall); item.setListSymbol(new Chunk("6.", mediumfont)); item.add(new Phrase( "Applicant Signature ___________________________________________________ Date ________________", smallfont)); item.setSpacingBefore(page1ListSpace); blist.add(item); document.add(blist); paragraph = new Paragraph(); paragraph.add(new Phrase( "A current list of Livescan sites is available at www.hslic.utah.gov/docs/livescan sites.pdf", smallfontB)); paragraph.setAlignment(Element.ALIGN_CENTER); paragraph.setSpacingBefore(page1SeparatorSpace); document.add(paragraph); if (screeningLetter.getTrackingRecordScreening().getTrsDpsFbi() != null && screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getBilling() != null && StringUtils.isNotBlank( screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getBilling().getValue())) { paragraph = new Paragraph(); paragraph.add( new Phrase(screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getBilling().getValue(), xlargefontB)); paragraph.setAlignment(Element.ALIGN_RIGHT); paragraph.setSpacingBefore(page1SeparatorSpace); document.add(paragraph); } /* * End of instructions list section */ }
From source file:gov.utah.dts.det.ccl.actions.trackingrecordscreening.letters.reports.LivescanAuthorization.java
private static void generateDocumentPage2(TrackingRecordScreeningLetter screeningLetter, Document document, PdfWriter writer) throws BadElementException, DocumentException, Exception { Paragraph paragraph = null;//from ww w .j a va2 s . c o m PdfPTable datatable = null; List blist = null; ListItem item = null; SimpleDateFormat df = new SimpleDateFormat("MM/dd/yyyy"); addLetterIdentifier(screeningLetter, document); // Add confidential header to document paragraph = new Paragraph(fixedLeadingMedium); paragraph.add(new Phrase("CONFIDENTIAL", mediumfontB)); paragraph.setAlignment(Element.ALIGN_CENTER); document.add(paragraph); // Add Date header datatable = getPage2HeaderTable(); datatable.addCell(new Phrase("Date:", mediumfont)); datatable.addCell(new Phrase(df.format(screeningLetter.getLetterDate()), mediumfont)); datatable.setSpacingBefore(20); document.add(datatable); // Add To header datatable = getPage2HeaderTable(); datatable.addCell(new Phrase("To:", mediumfont)); datatable.addCell(new Phrase( "Director, " + screeningLetter.getTrackingRecordScreening().getFacility().getName(), mediumfont)); datatable.setSpacingBefore(page2SeparatorSpace); document.add(datatable); // Add From header datatable = getPage2HeaderTable(); datatable.addCell(new Phrase("From:", mediumfont)); datatable.addCell(new Phrase( screeningLetter.getCreatedBy().getFirstAndLastName() + ", Criminal Background Screening Unit", mediumfont)); datatable.setSpacingBefore(page2SeparatorSpace); document.add(datatable); // Add Subject Header datatable = getPage2HeaderTable(); datatable.addCell(new Phrase("Re:", mediumfont)); datatable.addCell(new Phrase("Background Screening Request for " + screeningLetter.getTrackingRecordScreening().getFirstAndLastName() + " (" + screeningLetter.getTrackingRecordScreening().getPersonIdentifier() + ")", mediumfont)); datatable.setSpacingBefore(page2SeparatorSpace); document.add(datatable); // Start adding letter body information paragraph = new Paragraph(fixedLeadingMedium); paragraph.add(new Phrase( "As a follow-up to your 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 informaiton is needed (UCA62A-2-120 and R501-14). ", mediumfont)); paragraph.add(new Phrase( "The applicant may have an unresolved issue. Please let the applicant know that s/he must resolve this matter before the ", mediumfont)); paragraph.add(new Phrase( "background screening can be conducted by the Office of Licensing. Once the applicant has resolved the issue, the applicant, ", mediumfont)); paragraph.add(new Phrase( "facility representative or foster care licensor must notify the Office of Licensing in writing in order for background ", mediumfont)); paragraph.add(new Phrase("screening to proceed.", mediumfont)); paragraph.setSpacingBefore(page2SeparatorSpace); document.add(paragraph); paragraph = new Paragraph(fixedLeadingMedium); paragraph.add(new Phrase( "This person is not cleared under licensing standards to have direct access to children or vulnerable adults:", mediumfontB)); paragraph.setSpacingBefore(10); document.add(paragraph); blist = new List(false, 10); blist.setIndentationLeft(indent); blist.setListSymbol(new Chunk(">", mediumfont)); item = new ListItem(fixedLeadingMedium); item.add(new Phrase( "If you choose to employ or retain this person, you are assuming full liability and must make sure the individual ", mediumfont)); item.add(new Phrase( "works under direct supervision, under the uninterrupted visual and auditory surveillance of the person doing the supervising.", mediumfont)); blist.add(item); item = new ListItem(fixedLeadingMedium); item.add(new Phrase( "If the person is to provide foster care services, a license will not be granted until the background screening is complete.", mediumfont)); blist.add(item); document.add(blist); paragraph = new Paragraph(fixedLeadingMedium); paragraph.add(new Phrase( "Please give a copy of this letter to the applicant and instruct the applicant to resolve the issue.", mediumfontB)); paragraph.setSpacingBefore(page2SeparatorSpace); document.add(paragraph); blist = new List(false, 10); blist.setIndentationLeft(indent); blist.setListSymbol(new Chunk(">", mediumfont)); item = new ListItem(fixedLeadingMedium); item.add(new Phrase( "S/he must resolve this matter before the background screening can be completed by the Office of Licensing.", mediumfont)); blist.add(item); document.add(blist); paragraph = new Paragraph(fixedLeadingMedium); paragraph.add( new Phrase("The Background Screening Technician must be notified of the resolution of the issue:", mediumfontB)); paragraph.setSpacingBefore(page2SeparatorSpace); document.add(paragraph); blist = new List(false, 10); blist.setIndentationLeft(indent); blist.setListSymbol(new Chunk(">", mediumfont)); item = new ListItem(fixedLeadingMedium); item.add(new Phrase( "If I do not receive information within 15 calendar days of the date of this notice regarding resolution of the issue, ", mediumfont)); item.add(new Phrase( "the Office of Licensing will close the background screening request for failure to provide information, and the ", mediumfont)); item.add(new Phrase( "applicant will not be allowed to have direct access to children or vulnerable adults in licensed programs.", mediumfont)); blist.add(item); document.add(blist); paragraph = new Paragraph(fixedLeadingMedium); paragraph.add(new Phrase("Issue needing resolution:", mediumfontB)); paragraph.setSpacingBefore(page2SeparatorSpace); document.add(paragraph); paragraph = new Paragraph(fixedLeadingMedium); paragraph.add(new Phrase( "[ X ] The Background screening application cannot be processed if the Livescan procedure is not completed.", mediumfontB)); paragraph.setSpacingBefore(page2SeparatorSpace); document.add(paragraph); blist = new List(false, 10); blist.setIndentationLeft(indent); blist.setListSymbol(new Chunk(">", mediumfont)); item = new ListItem(fixedLeadingMedium); item.add(new Phrase( "Please have applicant submit to electronic fingerprinting using the Authorization form issued and mailed to your office.", mediumfont)); blist.add(item); item = new ListItem(fixedLeadingMedium); item.add(new Phrase( "If the applicant is no longer pursuing employment or applying to provide services to your program, please send me a ", mediumfont)); item.add(new Phrase("statement on letterhead so I may close this file.", mediumfont)); blist.add(item); document.add(blist); // Add document footer paragraph = new Paragraph(fixedLeadingMedium); paragraph.add(new Phrase( "*The Office of Licensing will accept a court record faxed by the court to the Office of Licensing at", smallfontB)); paragraph.setAlignment(Element.ALIGN_CENTER); paragraph.setSpacingBefore(15); document.add(paragraph); paragraph = new Paragraph(fixedLeadingMedium); paragraph.add(new Phrase("(801) 538-4669.", smallfontB)); paragraph.setAlignment(Element.ALIGN_CENTER); paragraph.setSpacingBefore(0); document.add(paragraph); paragraph = new Paragraph(fixedLeadingMedium); paragraph.add(new Phrase( "Thank you for your attention to providing complete and accurate information necessary for the background screening.", smallfontB)); paragraph.setAlignment(Element.ALIGN_CENTER); paragraph.setSpacingBefore(0); document.add(paragraph); paragraph = new Paragraph(fixedLeadingMedium); paragraph.add(new Phrase("If you have any questions, please call the Office of Licensing at 801-538-4242.", smallfontB)); paragraph.setAlignment(Element.ALIGN_CENTER); paragraph.setSpacingBefore(0); document.add(paragraph); }