List of usage examples for com.itextpdf.text Paragraph setIndentationLeft
public void setIndentationLeft(float indentation)
From source file:de.jost_net.JVerein.gui.action.SpendenbescheinigungPrintAction.java
License:Open Source License
/** * Generierung des Standard-Dokumentes zu verwenden fr Spendenbescheinigungen * ab 01.01.2014// ww w .j a va 2s .c o m * * @param spb * Die Spendenbescheinigung aus der Datenbank * @param fileName * Der Dateiname, wohin das Dokument geschrieben werden soll * @throws IOException * @throws DocumentException */ private void generiereSpendenbescheinigungStandardAb2014(Spendenbescheinigung spb, String fileName) throws IOException, DocumentException { final File file = new File(fileName); FileOutputStream fos = new FileOutputStream(file); Map<String, Object> map = spb.getMap(null); map = new AllgemeineMap().getMap(map); boolean isSammelbestaetigung = spb.isSammelbestaetigung(); Reporter rpt = new Reporter(fos, 80, 50, 50, 50); rpt.addHeaderColumn("Aussteller (Bezeichnung und Anschrift der steuerbegnstigten Einrichtung)", Element.ALIGN_CENTER, 100, BaseColor.LIGHT_GRAY); rpt.createHeader(); rpt.addColumn("\n" + getAussteller() + "\n ", Element.ALIGN_LEFT); rpt.closeTable(); if (isSammelbestaetigung) { rpt.add("Sammelbesttigung ber " + map.get(SpendenbescheinigungVar.SPENDEART.getName()), 13); } else { rpt.add("Besttigung ber " + map.get(SpendenbescheinigungVar.SPENDEART.getName()), 13); } rpt.add("im Sinne des 10b des Einkommenssteuergesetzes an eine der in 5 Abs. 1 Nr. 9 des Krperschaftssteuergesetzes " + "bezeichneten Krperschaften, Personenvereinigungen oder Vermgensmassen\n", 10); rpt.addHeaderColumn("Name und Anschrift des Zuwendenden", Element.ALIGN_CENTER, 100, BaseColor.LIGHT_GRAY); rpt.createHeader(); rpt.addColumn((String) map.get(SpendenbescheinigungVar.EMPFAENGER.getName()), Element.ALIGN_LEFT); rpt.closeTable(); switch (spb.getSpendenart()) { case Spendenart.GELDSPENDE: rpt.addHeaderColumn("Betrag der Zuwendung -in Ziffern-", Element.ALIGN_CENTER, 100, BaseColor.LIGHT_GRAY); break; case Spendenart.SACHSPENDE: rpt.addHeaderColumn("Wert der Zuwendung -in Ziffern-", Element.ALIGN_CENTER, 100, BaseColor.LIGHT_GRAY); break; } rpt.addHeaderColumn("-in Buchstaben-", Element.ALIGN_CENTER, 250, BaseColor.LIGHT_GRAY); if (!isSammelbestaetigung) { rpt.addHeaderColumn("Tag der Zuwendung", Element.ALIGN_CENTER, 50, BaseColor.LIGHT_GRAY); } else { rpt.addHeaderColumn("Zeitraum der Sammelbesttigung", Element.ALIGN_CENTER, 75, BaseColor.LIGHT_GRAY); } rpt.createHeader(); rpt.addColumn( "*" + Einstellungen.DECIMALFORMAT.format(map.get(SpendenbescheinigungVar.BETRAG.getName())) + "*", Element.ALIGN_CENTER); rpt.addColumn((String) map.get(SpendenbescheinigungVar.BETRAGINWORTEN.getName()), Element.ALIGN_CENTER); if (!isSammelbestaetigung) { rpt.addColumn((String) map.get(SpendenbescheinigungVar.SPENDEDATUM.getName()), Element.ALIGN_CENTER); } else { rpt.addColumn((String) map.get(SpendenbescheinigungVar.SPENDENZEITRAUM.getName()), Element.ALIGN_CENTER); } rpt.closeTable(); switch (spb.getSpendenart()) { case Spendenart.SACHSPENDE: rpt.addHeaderColumn("Genaue Bezeichnung der Sachzuwendung mit Alter, Zustand, Kaufpreis usw.", Element.ALIGN_CENTER, 100, BaseColor.LIGHT_GRAY); rpt.createHeader(); rpt.addColumn(spb.getBezeichnungSachzuwendung(), Element.ALIGN_LEFT); rpt.closeTable(); switch (spb.getHerkunftSpende()) { case HerkunftSpende.BETRIEBSVERMOEGEN: rpt.add("Die Sachzuwendung stammt nach den Angaben des Zuwendenden aus dem Betriebsvermgen. " + "Die Zuwendung wurde mit dem Wert der Entnahme (ggf. mit dem niedrigeren gemeinen " + "Wert) und nach der Umsatzsteuer, die auf die Entnahme entfllt, bewertet.\n\n", 9); break; case HerkunftSpende.PRIVATVERMOEGEN: rpt.add("Die Sachzuwendung stammt nach den Angaben des Zuwendenden aus dem Privatvermgen.\n\n", 9); break; case HerkunftSpende.KEINEANGABEN: rpt.add("Der Zuwendende hat trotz Aufforderung keine Angaben zur Herkunft der Sachzuwendung gemacht.\n\n", 9); break; } if (spb.getUnterlagenWertermittlung()) { rpt.add("Geeignete Unterlagen, die zur Wertermittlung gedient haben, z. B. Rechnung, Gutachten, liegen vor.\n\n", 9); } } /* * Bei Sammelbesttigungen ist der Verweis auf Verzicht in der Anlage * vermerkt */ String verzicht = ""; char verzichtJa = (char) 113; // box leer char verzichtNein = (char) 53; // X if (spb.getAutocreate()) { if (!isSammelbestaetigung && spb.getSpendenart() == Spendenart.GELDSPENDE) { if (spb.getBuchungen().get(0).getVerzicht().booleanValue()) { verzichtJa = (char) 53; // X verzichtNein = (char) 113; // box leer } } } else { if (spb.getErsatzAufwendungen()) { verzichtJa = (char) 53; // X verzichtNein = (char) 113; // box leer } } if (!isSammelbestaetigung) { Paragraph p = new Paragraph(); p.setFont(Reporter.getFreeSans(8)); p.setAlignment(Element.ALIGN_LEFT); p.add(new Chunk("Es handelt sich um den Verzicht auf Erstattung von Aufwendungen: ")); p.add(new Chunk(" Ja ", Reporter.getFreeSansBold(9))); p.add(new Chunk(verzichtJa, FontFactory.getFont(FontFactory.ZAPFDINGBATS, 10))); p.add(new Chunk(" Nein ", Reporter.getFreeSansBold(9))); p.add(new Chunk(verzichtNein, FontFactory.getFont(FontFactory.ZAPFDINGBATS, 10))); p.add(new Chunk("\n\n")); rpt.add(p); } else { rpt.add(new Paragraph(" ", Reporter.getFreeSans(12))); } if (Einstellungen.getEinstellung().getVorlaeufig()) { // Verein neu gegrndet, hat noch keinen Bescheid String txt = "Die Einhaltung der satzungsgemen Voraussetzungen nach den 51, 59, 60 und 61 " + "AO wurde vom Finanzamt " + Einstellungen.getEinstellung().getFinanzamt() + ", StNr. " + Einstellungen.getEinstellung().getSteuernummer() + ", mit Bescheid vom " + new JVDateFormatTTMMJJJJ().format(Einstellungen.getEinstellung().getBescheiddatum()) + " nach 60a AO gesondert festgestellt. Wir frdern nach unserer Satzung " + Einstellungen.getEinstellung().getBeguenstigterzweck(); rpt.add(txt, 8); } else { // Verein existiert und hat einen Bescheid bekommen String txt = "Wir sind wegen " + Einstellungen.getEinstellung().getBeguenstigterzweck() + " nach dem Freistellungsbescheid bzw. nach der Anlage zum Krperschaftssteuerbescheid " + "des Finanzamtes " + Einstellungen.getEinstellung().getFinanzamt() + ", StNr. " + Einstellungen.getEinstellung().getSteuernummer() + ", vom " + new JVDateFormatTTMMJJJJ().format(Einstellungen.getEinstellung().getBescheiddatum()) + " fr den letzten Veranlagungszeitraum " + new JVDateFormatJJJJ().format(Einstellungen.getEinstellung().getVeranlagungVon()) + " bis " + new JVDateFormatJJJJ().format(Einstellungen.getEinstellung().getVeranlagungBis()) + " nach 5 Abs. 1 Nr. 9 des Krperschaftsteuergesetzes von der Krperschaftsteuer und nach " + " 3 Nr. 6 des Gewerbesteuergesetzes von der Gewerbesteuer befreit."; rpt.add(txt, 8); } rpt.add("\nEs wird besttigt, dass die Zuwendung nur zur " + Einstellungen.getEinstellung().getBeguenstigterzweck() + " verwendet wird.\n", 8); if (spb.getSpendenart() == Spendenart.GELDSPENDE) { char mitgliedBetraege = (char) 113; // box leer if (!Einstellungen.getEinstellung().getMitgliedsbetraege()) { mitgliedBetraege = (char) 53; // X } Paragraph p = new Paragraph(); p.setFont(Reporter.getFreeSans(8)); p.setAlignment(Element.ALIGN_LEFT); p.add(new Chunk("\n")); p.add(new Chunk( "Nur fr steuerbegnstigte Einrichtungen, bei denen die Mitgliedsbeitrge steuerlich nicht abziehbar sind:")); rpt.add(p); p = new Paragraph(); p.setFont(Reporter.getFreeSans(8)); p.setAlignment(Element.ALIGN_JUSTIFIED); p.setFirstLineIndent((float) -18.5); p.setIndentationLeft((float) 18.5); p.add(new Chunk(mitgliedBetraege, FontFactory.getFont(FontFactory.ZAPFDINGBATS, 10))); p.add(new Chunk( " Es wird besttigt, dass es sich nicht um einen Mitgliedsbeitrag handelt, dessen Abzug nach 10b Abs. 1 des Einkommensteuergesetzes ausgeschlossen ist.")); rpt.add(p); } if (isSammelbestaetigung) { rpt.add(new Paragraph(" ", Reporter.getFreeSans(12))); rpt.add("Es wird besttigt, dass ber die in der Gesamtsumme enthaltenen Zuwendungen keine weiteren Besttigungen, weder formelle Zuwendungsbesttigungen noch Beitragsquittungen oder hnliches ausgestellt wurden und werden.\n", 8); rpt.add("Ob es sich um den Verzicht auf Erstattung von Aufwendungen handelt, ist der Anlage zur Sammelbesttigung zu entnehmen.", 8); } else { rpt.add(new Paragraph(" ", Reporter.getFreeSans(12))); rpt.add("\n\n", 8); rpt.add("\n", 9); } rpt.add("\n\n" + Einstellungen.getEinstellung().getOrt() + ", " + new JVDateFormatTTMMJJJJ().format(spb.getBescheinigungsdatum()), 9); rpt.add("\n\n\n\n.................................................................................\nUnterschrift des Zuwendungsempfngers", 8); rpt.add("\nHinweis:", 8); rpt.add("Wer vorstzlich oder grob fahrlssig eine unrichtige Zuwendungsbesttigung erstellt " + "oder veranlasst, dass Zuwendungen nicht zu den in der Zuwendungsbesttigung " + "angegebenen steuerbegnstigten Zwecken verwendet werden, haftet fr die entgangene " + "Steuer ( 10b Absatz 4 EStG, 9 Absatz 3 KStG, 9 Nummer 5 GewStG).\n" + "\n" + "Diese Besttigung wird nicht als Nachweis fr die steuerliche Bercksichtigung der " + "Zuwendung anerkannt, wenn das Datum des Freistellungsbescheides lnger als 5 Jahre " + "bzw. das Datum der Feststellung der Einhaltung der satzungsmigen Voraussetzungen " + "nach 60a Abs. 1 AO lnger als 3 Jahre seit Ausstellung des Bescheides zurckliegt " + "( 63 Abs. 5 AO).", 7); /* Es sind mehrere Spenden fr diese Spendenbescheinigung vorhanden */ if (isSammelbestaetigung) { List<Buchung> buchungen = spb.getBuchungen(); rpt.newPage(); rpt.add(getAussteller(), 13); rpt.add(new Paragraph(" ", Reporter.getFreeSans(12))); rpt.add("Anlage zur Sammelbesttigung vom " + (String) map.get(SpendenbescheinigungVar.BESCHEINIGUNGDATUM.getName()), 11); rpt.add("fr den Zeitraum vom " + (String) map.get(SpendenbescheinigungVar.SPENDENZEITRAUM.getName()), 11); rpt.add(new Paragraph(" ", Reporter.getFreeSans(12))); /* Kopfzeile */ rpt.addHeaderColumn("Datum der\nZuwendung", Element.ALIGN_LEFT, 150, BaseColor.LIGHT_GRAY); rpt.addHeaderColumn("Art der\nZuwendung", Element.ALIGN_LEFT, 400, BaseColor.LIGHT_GRAY); rpt.addHeaderColumn("Verzicht auf die\nErstattung von Aufwendungen", Element.ALIGN_LEFT, 300, BaseColor.LIGHT_GRAY); rpt.addHeaderColumn("Betrag", Element.ALIGN_RIGHT, 150, BaseColor.LIGHT_GRAY); rpt.createHeader(); boolean printBuchungsart = Einstellungen.getEinstellung().getSpendenbescheinigungPrintBuchungsart(); /* Buchungszeilen */ for (Buchung buchung : buchungen) { rpt.addColumn(buchung.getDatum(), Element.ALIGN_RIGHT); String verwendung = ""; if (printBuchungsart) { verwendung = buchung.getBuchungsart().getBezeichnung(); } else { verwendung = buchung.getZweck(); } rpt.addColumn(verwendung, Element.ALIGN_LEFT); if (buchung.getVerzicht().booleanValue()) { verzicht = "ja"; } else { verzicht = "nein"; } rpt.addColumn(verzicht, Element.ALIGN_CENTER); rpt.addColumn(Double.valueOf(buchung.getBetrag())); } /* Summenzeile */ // String sumString = // Einstellungen.DECIMALFORMAT.format(spb.getBetrag()); rpt.addColumn("Gesamtsumme", Element.ALIGN_LEFT, BaseColor.LIGHT_GRAY); rpt.addColumn("", Element.ALIGN_LEFT, BaseColor.LIGHT_GRAY); rpt.addColumn("", Element.ALIGN_LEFT, BaseColor.LIGHT_GRAY); rpt.addColumn(Double.valueOf(spb.getBetrag())); // rpt.addColumn(sumString, Element.ALIGN_RIGHT, // BaseColor.LIGHT_GRAY); rpt.closeTable(); // // Etwas Abstand // rpt.add(new Paragraph(" ")); // // Nun noch die Legende // rpt.add("Legende:", 8); // rpt.add( // "(a): Es handelt sich nicht um den Verzicht auf Erstattung von // Aufwendungen", // 8); // rpt.add( // "(b): Es handelt sich um den Verzicht auf Erstattung von Aufwendungen", // 8); } rpt.close(); fos.close(); }
From source file:eu.aniketos.wp1.ststool.report.pdfgenerator.ReportContentFactory.java
License:Open Source License
private void buildSectionSecurityAnalysis(Section section) { String sectionIntro = "The purpose of security analysis is to verify whether the diagram for the project " + getProjectName()// w w w .j a va 2 s . c om + " allows the satisfaction of the specified security needs or not. As a result, for all security needs expressed by stakeholders, it checks in the model whether there is any possibility for the security need to be violated. This analysis takes into account the semantics of STS-ml, defining the behaviour of the different elements represented in the models. The elements behaviour is defined by propagation rules that consider what concepts and what relationships the specification of a given security need affects. Datalog is used to define the semantics of STS-ml to express facts (things always hold) and rules."; Paragraph pIntro = createParagraph(sectionIntro); pIntro.setSpacingAfter(8); section.add(pIntro); if (generateAppendixCChapter()) { String appBref = "You can find more details about the performed checks in Appendix C."; section.add(createParagraph(appBref)); } ConsistencyAnalysisTasks t = new ConsistencyAnalysisTasks(1); DiagramAnalyser analyser = new DiagramAnalyser(); analyser.addTaskGroup(t); boolean analysisRes = analyser.evaluateCurrentDiagram(); if (analysisRes) { analyser.removeAllTaskGroups(); analyser.addTaskGroup(new SecurityAnalysisTasks("", 1)); AnalysisDescriptor ad = new AnalysisDescriptor("Security", FigureConstant.SECURITY_RES_TABLE); analyser.addTaskListener(ad); analyser.evaluateCurrentDiagram(); section.add(ad.getFinalParagraph()); } else { Paragraph p = createParagraph("%i" + "The security analysis for " + getProjectName() + " couldn't be performed because the consistency analysis has identified some errors that need to be fixed first." + "% "); p.setIndentationLeft(15); } section.setComplete(true); }
From source file:gov.nih.nci.firebird.service.pdf.AdditionalContent.java
License:Open Source License
private ColumnText createText() { ColumnText text = new ColumnText(null); for (PageSection section : sections) { Paragraph header = new Paragraph(section.getHeader(), HEADER_FONT); text.addElement(header);/*from w ww. ja va 2 s .co m*/ Paragraph content = new Paragraph(section.getContent(), CONTENT_FONT); content.setIndentationLeft(CONTENT_INDENTATION); content.setSpacingAfter(CONTENT_SPACING); text.addElement(content); } return text; }
From source file:gov.utah.dts.det.ccl.actions.facility.information.license.reports.LicenseLetter.java
private static void writePdf(License license, ByteArrayOutputStream ba, HttpServletRequest request) throws DocumentException, BadElementException, IOException { Document document = null;/*from ww w . j a v a2 s.c om*/ Paragraph paragraph = null; document = new Document(PageSize.LETTER, 50, 50, 190, 75); PdfWriter writer = PdfWriter.getInstance(document, ba); SimpleDateFormat df = new SimpleDateFormat("MMMM d, yyyy"); SimpleDateFormat df2 = new SimpleDateFormat("MM/dd/yyyy"); Date today = new Date(); StringBuilder sb; document.open(); LetterheadStamper.stampLetter(writer, request); // Add report date paragraph = getParagraph(); paragraph.add(new Phrase(df.format(today), mediumfont)); paragraph.setIndentationLeft(rightindent); document.add(paragraph); // Add facility name and address information paragraph = getParagraph(); paragraph.add(new Phrase(license.getFacility().getName().toUpperCase(), mediumfont)); paragraph.setSpacingBefore(20); document.add(paragraph); if (StringUtils.isNotBlank(license.getFacility().getSiteName())) { paragraph = getParagraph(); paragraph.add(new Phrase(license.getFacility().getSiteName().toUpperCase(), mediumfont)); document.add(paragraph); } paragraph = getParagraph(); try { paragraph.add(new Phrase(license.getFacility().getMailingAddress().getAddressOne().toUpperCase(), mediumfont)); } catch (Exception e) { paragraph.add(new Phrase("Mailing Address", mediumfont)); } document.add(paragraph); try { if (StringUtils.isNotBlank(license.getFacility().getMailingAddress().getAddressTwo())) { // Add facility location address two paragraph = getParagraph(); paragraph.add(new Phrase(license.getFacility().getMailingAddress().getAddressTwo().toUpperCase(), mediumfont)); document.add(paragraph); } } catch (Exception e) { // Skip if no address found } paragraph = getParagraph(); try { paragraph.add(new Phrase(license.getFacility().getMailingAddress().getCityStateZip().toUpperCase(), mediumfont)); } catch (Exception e) { paragraph.add(new Phrase("City, State Zipcode", mediumfont)); } document.add(paragraph); // Add subject information paragraph = getParagraph(); sb = new StringBuilder(); sb.append("SUBJECT: LICENSE APPROVAL"); if (license.getSubtype() != null && StringUtils.isNotBlank(license.getSubtype().getValue())) { sb.append(" - " + license.getSubtype().getValue().toUpperCase()); } paragraph.add(new Phrase(sb.toString(), mediumfont)); paragraph.setSpacingBefore(paragraphSpacing); document.add(paragraph); // Add salutation paragraph = getParagraph(); paragraph.add(new Phrase("Dear Director:", mediumfont)); paragraph.setSpacingBefore(paragraphSpacing); document.add(paragraph); // Start letter detail paragraph = getParagraph(); sb = new StringBuilder(); sb.append("Your application to provide "); // Get the Service Code Definition String service = ""; if (license.getSpecificServiceCode() != null && StringUtils.isNotBlank(license.getSpecificServiceCode().getValue()) && DV_TREATMENT.equalsIgnoreCase(license.getSpecificServiceCode().getValue())) { service = DOMESTIC_VIOLENCE; } if (!license.getProgramCodeIds().isEmpty()) { // redmine 25410 mentalHealthLoop: for (PickListValue pkv : license.getProgramCodeIds()) { String program = pkv.getValue(); int idx = program.indexOf(" "); if (idx >= 0) { String code = program.substring(0, idx); if (MENTAL_HEALTH_CODES.indexOf(code + ":") >= 0) { if (service.length() > 0) { service += "/"; } service += MENTAL_HEALTH; break mentalHealthLoop; } } } substanceAbuseLoop: for (PickListValue pkv : license.getProgramCodeIds()) { String program = pkv.getValue(); int idx = program.indexOf(" "); if (idx >= 0) { String code = program.substring(0, idx); if (SUBSTANCE_ABUSE_CODES.indexOf(code + ":") >= 0) { if (service.length() > 0) { service += "/"; } service += SUBSTANCE_ABUSE; break substanceAbuseLoop; } } } } if (license.getServiceCode() != null && StringUtils.isNotBlank(license.getServiceCode().getValue())) { if (service.length() > 0) { service += "/"; } String code = license.getServiceCode().getValue(); int idx = code.indexOf("-"); if (idx > -1) { idx++; code = code.substring(idx).trim(); } service += code; } sb.append(service); sb.append(" for "); if (license.getAgeGroup() == null || license.getAgeGroup().getValue().equalsIgnoreCase("Adult & Youth")) { // Adult & Youth if (license.getAdultTotalSlots() != null) { sb.append(license.getAdultTotalSlots().toString()); } sb.append(" adult and youth clients"); } else if (license.getAgeGroup().getValue().equalsIgnoreCase("Adult")) { // Adult if (license.getAdultTotalSlots() != null) { // Are male or female counts specified? sb.append(license.getAdultTotalSlots().toString()); sb.append(" adult"); if (license.getAdultFemaleCount() != null || license.getAdultMaleCount() != null) { // Does either the male or female count equal the total slot count? if ((license.getAdultFemaleCount() != null && license.getAdultFemaleCount().equals(license.getAdultTotalSlots()))) { sb.append(" female clients"); } else if (license.getAdultMaleCount() != null && license.getAdultMaleCount().equals(license.getAdultTotalSlots())) { sb.append(" male clients"); } else { sb.append(" clients, "); if (license.getAdultMaleCount() != null) { sb.append(license.getAdultMaleCount().toString() + " male"); } if (license.getAdultFemaleCount() != null) { if (license.getAdultMaleCount() != null) { sb.append(" and "); } sb.append(license.getAdultFemaleCount().toString() + " female"); } if (license.getFromAge() != null || license.getToAge() != null) { sb.append(","); } } } else { sb.append(" clients"); } } else { sb.append(" adult clients"); } } else { // Youth if (license.getYouthTotalSlots() != null) { // Are male or female counts specified? sb.append(license.getYouthTotalSlots().toString()); sb.append(" youth"); if (license.getYouthFemaleCount() != null || license.getYouthMaleCount() != null) { // Does either the male or female count equal the total slot count? if ((license.getYouthFemaleCount() != null && license.getYouthFemaleCount().equals(license.getYouthTotalSlots()))) { sb.append(" female clients"); } else if (license.getYouthMaleCount() != null && license.getYouthMaleCount().equals(license.getYouthTotalSlots())) { sb.append(" male clients"); } else { sb.append(" clients, "); if (license.getYouthMaleCount() != null) { sb.append(license.getYouthMaleCount().toString() + " male"); } if (license.getYouthFemaleCount() != null) { if (license.getYouthMaleCount() != null) { sb.append(" and "); } sb.append(license.getYouthFemaleCount().toString() + " female"); } if (license.getFromAge() != null || license.getToAge() != null) { sb.append(","); } } } else { sb.append(" clients"); } } else { sb.append(" youth clients"); } } if (license.getFromAge() != null || license.getToAge() != null) { sb.append(" ages "); if (license.getFromAge() != null) { sb.append(license.getFromAge().toString()); if (license.getToAge() != null) { sb.append(" to " + license.getToAge().toString()); } else { sb.append(" and older"); } } else { sb.append("to " + license.getToAge().toString()); } } if (StringUtils.isNotBlank(license.getCertificateComment())) { sb.append(" "); sb.append(license.getCertificateComment()); } sb.append(" has been approved."); paragraph.add(new Phrase(sb.toString(), mediumfont)); paragraph.setSpacingBefore(paragraphSpacing); document.add(paragraph); paragraph = getParagraph(); sb = new StringBuilder(); sb.append("The license is issued for the period from "); sb.append(df2.format(license.getStartDate())); sb.append(" to "); sb.append(df2.format(license.getEndDate())); sb.append( ". The enclosed license is subject to revocation for cause; or if there should be any change in the management, ownership, or address of the facility, "); sb.append( "the license is automatically void and should be returned to our office. The enclosed license must be posted in the facility."); paragraph.add(new Phrase(sb.toString(), mediumfont)); paragraph.setSpacingBefore(paragraphSpacing); document.add(paragraph); paragraph = getParagraph(); sb = new StringBuilder(); sb.append( "The approval of your license is based upon reports submitted to this office by our staff and by the "); sb.append( "collaberative agencies which show that reasonable standards of care are maintained and the services "); sb.append("provided meet the requirements established by our State Standards."); paragraph.add(new Phrase(sb.toString(), mediumfont)); paragraph.setSpacingBefore(paragraphSpacing); document.add(paragraph); paragraph = getParagraph(); sb = new StringBuilder(); sb.append( "During the period for which the license is granted, representatives from this office and other collaborative "); sb.append( "agencies may make periodic supervisory visits and will be available for consultation. Please feel free to "); sb.append("request assistance at any time."); paragraph.add(new Phrase(sb.toString(), mediumfont)); paragraph.setSpacingBefore(paragraphSpacing); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase(license.getFacility().getLicensingSpecialist().getFirstAndLastName(), mediumfont)); paragraph.setSpacingBefore(paragraphSpacing); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase("Licensing Specialist", mediumfont)); document.add(paragraph); paragraph = getParagraph(); sb = new StringBuilder(); sb.append("Enclosure: License #"); if (license.getLicenseNumber() != null) { sb.append(license.getLicenseNumber().toString()); } paragraph.add(new Phrase(sb.toString(), mediumfont)); paragraph.setSpacingBefore(paragraphSpacing); document.add(paragraph); // Check to see if Program Code starts with 'D' if (!license.getProgramCodeIds().isEmpty()) { // redmine 25410 multiple program codes sb = new StringBuilder(); for (PickListValue pkv : license.getProgramCodeIds()) { if (pkv.getValue() != null && pkv.getValue().length() >= 4) { String code = pkv.getValue().substring(0, 4).toUpperCase(); if (CC_PROGRAM_CODES.contains(code)) { if (sb.length() > 0) { sb.append(", "); } sb.append(code); } } } if (sb.length() > 0) { paragraph = getParagraph(); paragraph.add(new Phrase("cc: " + sb.toString(), mediumfont)); document.add(paragraph); } } document.close(); }
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;/*from w w w . ja va2s.c o 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.FailureToProvideInformationLetterDSPDC.java
private static void writePdf(TrackingRecordScreeningLetter screeningLetter, OutputStream ba, HttpServletRequest request) throws DocumentException, BadElementException, IOException { Document document = null;//from w w w . ja va2 s . com Paragraph paragraph = 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("FPI DSPDC", smallfont)); paragraph.setIndentationLeft(415); document.add(paragraph); paragraph.clear(); paragraph.add(new Phrase("Rev 7/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 salutation paragraph = getParagraph(); paragraph.add(new Phrase("Dear Director:", mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); // Add subject information paragraph = getParagraph(); paragraph.add(new Phrase("RE: Notice of Agency Action", 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 FPI Details Line paragraph.clear(); paragraph.add(new Phrase(screeningLetter.getDetails(), mediumfont)); document.add(paragraph); // Start letter detail paragraph = getParagraph(); paragraph.add(new Phrase( "In accordance with the Utah Administrative Procedures Act, Utah Code Ann. 63-46b-1 et. Seq, Utah Code Ann. 62A-2-101-116, ", mediumfont)); paragraph.add(new Phrase( "Utah Code Ann. 62A-2-120 and Utah Department of Human Services rules, notice is hereby given of an Agency Action to deny the applicant's ", mediumfont)); paragraph.add(new Phrase("background screening application.", mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase( "The named individual failed to provide this office with required information to complete a background clearance by the Department ", mediumfont)); paragraph.add(new Phrase( "of Human Services, and therefore is not permitted to have direct access to children or vulnerable adults, is not eligible to provide services ", mediumfont)); paragraph.add(new Phrase( "to programs licensed by the Utah Department of Human Services, Office of Licensing, and is not eligible to proceed with foster care or ", mediumfont)); paragraph.add(new Phrase("adoption until all procedures are completed.", mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase("Please provide a copy of this letter to the applicant.", mediumfontB)); paragraph.setSpacingBefore(10); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase( "If the person is an applicant for adoption or foster care services, no further action can be taken in the licensing ", mediumfont)); paragraph.add(new Phrase("process unless the denial is reversed after all appeals are final.", mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase( "If the person is NOT an applicant for adoption or foster care services, you must immediately provide your Licensing Specialist ", mediumfont)); paragraph.add(new Phrase( "with written notification as to how you intend to prevent the applicant from having any direct access to children or vulnerable adults.", mediumfont)); paragraph.add(new Phrase( "The applicant is not authorized to have any direct access to children or vulnerable adults unless the denial is reversed after ", mediumfont)); paragraph.add(new Phrase("all appeals are final.", mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase( "Please direct any questions concerning this action to the Office of Licensing, Background Screening Unit, at ", mediumfont)); paragraph.add(new Phrase("(801) 538-4242, or fax to me at (801) 538-4669.", 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); paragraph = getParagraph(); paragraph.add(new Phrase("cc: Cathy Davis, DSPD", mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase("File", mediumfont)); paragraph.setIndentationLeft(18); document.add(paragraph); document.close(); }
From source file:gov.utah.dts.det.ccl.actions.trackingrecordscreening.letters.reports.FailureToProvideInformationLetterFC.java
private static void writePdf(TrackingRecordScreeningLetter screeningLetter, OutputStream ba, HttpServletRequest request) throws DocumentException, BadElementException, IOException { Document document = null;//w ww . j a v a 2 s. c o m Paragraph paragraph = 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("FPI FC", smallfont)); paragraph.setIndentationLeft(415); document.add(paragraph); paragraph.clear(); paragraph.add(new Phrase("Rev 7/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(); try { paragraph.add(new Phrase(screeningLetter.getTrackingRecordScreening().getFacility() .getLicensingSpecialist().getFirstAndLastName().toUpperCase(), mediumfont)); } catch (Exception e) { paragraph.add(new Phrase("(Licensing Specialist Name)", mediumfontB)); } 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 salutation paragraph = getParagraph(); paragraph.add(new Phrase("Dear Licensor:", mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); // Add subject information paragraph = getParagraph(); paragraph.add(new Phrase("RE: Notice of Agency Action", 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 FPI Details Line paragraph.clear(); paragraph.add(new Phrase(screeningLetter.getDetails(), mediumfont)); document.add(paragraph); // Start letter detail paragraph = getParagraph(); paragraph.add(new Phrase("In accordance with the Utah Administrative Procedures Act, Utah Code Ann. ", mediumfont)); paragraph.add(new Chunk("\u00A7", mediumfont)); paragraph.add(new Phrase(" 63-46b-1 et. Seq, Utah Code Ann. ", mediumfont)); paragraph.add(new Chunk("\u00A7", mediumfont)); paragraph.add(new Phrase(" 62A-2-101-116, ", mediumfont)); paragraph.add(new Phrase("Utah Code Ann. ", mediumfont)); paragraph.add(new Chunk("\u00A7", mediumfont)); paragraph.add(new Phrase( " 62A-2-120 and Utah Department of Human Services rules, notice is hereby given of an Agency Action to deny the applicant's ", mediumfont)); paragraph.add(new Phrase("background screening application.", mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase( "The named individual failed to provide this office with required information to complete a background clearance by the Department ", mediumfont)); paragraph.add(new Phrase( "of Human Services, and therefore is not eligible to provide services to children, or programs licensed to DHS OL.", mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase("Please provide a copy of this letter to the applicant.", mediumfontB)); paragraph.setSpacingBefore(10); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase( "If the person is an applicant for adoption or foster care services, no further action can be taken in the licensing ", mediumfont)); paragraph.add(new Phrase("process unless the denial is reversed after all appeals are final.", mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase( "Please direct any questions concerning this action to the Office of Licensing, Background Screening Unit, at ", mediumfont)); paragraph.add(new Phrase("(801) 538-4242, or fax to me at (801) 538-4669. Thank you.", 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); document.close(); }
From source file:gov.utah.dts.det.ccl.actions.trackingrecordscreening.letters.reports.FailureToProvideInformationLetterTX.java
private static void writePdf(TrackingRecordScreeningLetter screeningLetter, OutputStream ba, HttpServletRequest request) throws DocumentException, BadElementException, IOException { Document document = null;//w w w . j a v a 2 s.c o m Paragraph paragraph = 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("FPI TX", smallfont)); paragraph.setIndentationLeft(415); document.add(paragraph); paragraph.clear(); paragraph.add(new Phrase("Rev 7/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 salutation paragraph = getParagraph(); paragraph.add(new Phrase("Dear Director:", mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); // Add subject information paragraph = getParagraph(); paragraph.add(new Phrase("RE: Notice of Agency Action", 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 FPI Details Line paragraph.clear(); paragraph.add(new Phrase(screeningLetter.getDetails(), mediumfont)); document.add(paragraph); // Start letter detail paragraph = getParagraph(); paragraph.add(new Phrase( "In accordance with the Utah Administrative Procedures Act, Utah Code Ann. 63-46b-1 et. Seq, Utah Code Ann. 62A-2-101-116, ", mediumfont)); paragraph.add(new Phrase( "Utah Code Ann. 62A-2-120 and Utah Department of Human Services rules, notice is hereby given of an Agency Action to deny the applicant's ", mediumfont)); paragraph.add(new Phrase("background screening application.", mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase( "The named individual failed to provide this office with required information to complete a background clearance by the Department ", mediumfont)); paragraph.add(new Phrase( "of Human Services, and therefore is not permitted to have direct access to children or vulnerable adults, is not eligible to provide services ", mediumfont)); paragraph.add(new Phrase( "to programs licensed by the Utah Department of Human Services, Office of Licensing, and is not eligible to proceed with foster care or ", mediumfont)); paragraph.add(new Phrase("adoption until all procedures are completed.", mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase("Please provide a copy of this letter to the applicant.", mediumfontB)); paragraph.setSpacingBefore(10); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase( "If the person is an applicant for adoption or foster care services, no further action can be taken in the licensing ", mediumfont)); paragraph.add(new Phrase("process unless the denial is reversed after all appeals are final.", mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase( "If the person is NOT an applicant for adoption or foster care services, you must immediately provide your Licensing Specialist ", mediumfontB)); paragraph.add(new Phrase( "with written notification as to how you intend to prevent the applicant from having any direct access to children or vulnerable adults.", mediumfontB)); paragraph.setSpacingBefore(10); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase( "The applicant is not authorized to have any direct access to children or vulnerable adults unless the denial is reversed after ", mediumfont)); paragraph.add(new Phrase("all appeals are final.", mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase( "Please direct any questions concerning this action to the Office of Licensing, Background Screening Unit, at ", mediumfont)); paragraph.add(new Phrase("(801) 538-4242, or fax to me at (801) 538-4669.", 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().getFirstAndLastName())) { paragraph = getParagraph(); paragraph.add(new Phrase("CC: " + screeningLetter.getTrackingRecordScreening().getFacility() .getLicensingSpecialist().getFirstAndLastName(), mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); } document.close(); }
From source file:gov.utah.dts.det.ccl.actions.trackingrecordscreening.letters.reports.FingerprintCardFeeOnlyLetterFC.java
private static void writePdf(TrackingRecordScreeningLetter screeningLetter, OutputStream ba, HttpServletRequest request) throws DocumentException, BadElementException, IOException { Document document = null;/*from w ww . j av a 2 s . c o m*/ Paragraph paragraph = 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); LetterheadStamper.stampLetter(writer, request); paragraph = getParagraph(10.0f); paragraph.add(new Phrase("FPF 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 = new Paragraph("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 Applicant:", 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( "You submitted fingerprint cards previously. We have one fingerprint card in your file that we can ", mediumfont)); paragraph.add(new Phrase( "use for the verification. To proceed with the verification, we request 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( "Submit the fee to the Office of Licensing within 5 working days of your receipt of this notice. Please be sure ", mediumfont)); paragraph.add( new Phrase("the payment references your name and last four digits of your social security number.", mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase( "Failure to return the fee within 5 working days will result in the background screening application being denied, and you ", mediumfont)); paragraph.add(new Phrase( "will not be eligible to be associated with the licensed program in any capacity or will not be eligible to proceed ", mediumfont)); paragraph.add(new Phrase("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 = 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.FingerprintCardFeeOnlyLetterTX.java
private static void writePdf(TrackingRecordScreeningLetter screeningLetter, OutputStream ba, HttpServletRequest request) throws DocumentException, BadElementException, IOException { Document document = null;//from www . ja v a2 s .co m Paragraph paragraph = 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("FPF 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( "The applicant submitted fingerprint cards previously. We have one fingerprint card on file that we can ", mediumfont)); paragraph.add(new Phrase( "use for the verification. To proceed with the verification, we request a $20 fee in the form of a ", mediumfont)); paragraph.add(new Phrase("cashier's check, money order, or program business check ", 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( "Submit the fee to the Office of Licensing within 5 working days of your receipt of this notice. Please be sure ", mediumfont)); paragraph.add(new Phrase( "the payment references the applicant's name and last four digits of the applicant's social security number.", mediumfont)); paragraph.setSpacingBefore(10); document.add(paragraph); paragraph = getParagraph(); paragraph.add(new Phrase( "Failure to return the fee within 5 working days will result in the background screening application being denied, and the ", mediumfont)); paragraph.add(new Phrase( "applicant will not be eligible to be associated with the licensed program in any capacity or will not be eligible to proceed ", mediumfont)); paragraph.add(new Phrase("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 = 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); document.close(); }