Example usage for com.itextpdf.text List setListSymbol

List of usage examples for com.itextpdf.text List setListSymbol

Introduction

In this page you can find the example usage for com.itextpdf.text List setListSymbol.

Prototype

public void setListSymbol(final String symbol) 

Source Link

Document

Sets the listsymbol.

Usage

From source file:com.github.wolfposd.imsqti2pdf.PDFCreator.java

License:Open Source License

private void addAnswerTexts(Paragraph paragraph, boolean showCorrectAnswer, Question question) {
    if (question.basetype == BaseType.IDENTIFIER) {
        List list = new List(false, 20);

        list.setListSymbol(SQUARE_CHUNK);
        for (String key : question.answers.keySet()) {
            String answer = question.answers.get(key);

            Double points = question.points.get(key);
            points = points == null ? 0 : points;
            if (showCorrectAnswer) {
                ListItem item = new ListItem(answer);
                item.getFont().setSize(OVERALLFONTSIZE);

                if (points > 0) {
                    item.getFont().setColor(39, 158, 35);
                } else {
                    // item.getFont().setColor(255, 0, 0);
                }/*from www.  j a v a  2 s .c om*/
                list.add(item);
            } else {
                ListItem item = new ListItem(answer);
                item.getFont().setSize(OVERALLFONTSIZE);
                list.add(item);
            }
        }

        paragraph.add(Chunk.NEWLINE);
        paragraph.add(list);
    } else if (question.basetype == BaseType.STRING) {
        paragraph.add(Chunk.NEWLINE);
        paragraph.add(Chunk.NEWLINE);

        if (showCorrectAnswer) {
            String key = question.points.keySet().iterator().next();
            Double points = question.points.get(key);

            paragraph.add(new Phrase(getXes(points) + " " + LocaleStrings.getString("answer") + " " + key));
        } else {
            paragraph.add(new Phrase(LocaleStrings.getString("answerLine")));
        }
    }
}

From source file:com.vectorprint.report.itext.style.stylers.ListItem.java

License:Open Source License

@Override
public <E> E style(E text, Object data) throws VectorPrintException {
    Chunk symbolChunk = new Chunk(getValue(SYMBOL_PARAM, String.class));
    if (getValue(SYMBOLIMAGE_PARAM, URL.class) != null) {
        symbolChunk = new Chunk(imageLoader.loadImage(getValue(SYMBOLIMAGE_PARAM, URL.class), 1), 0, 0);
    }//from   w  w  w  .j av a 2s. c o m
    if (text instanceof com.itextpdf.text.List) {
        com.itextpdf.text.List l = (com.itextpdf.text.List) text;
        l.setListSymbol(super.style(symbolChunk, data));
    } else {
        com.itextpdf.text.ListItem l = (com.itextpdf.text.ListItem) text;
        l.setListSymbol(super.style(symbolChunk, data));
    }
    return text;
}

From source file:de.extra.xtt.util.pdf.PdfCreatorImpl.java

License:Apache License

/**
 * Fr die angegebenen Kindlemente wird ein Listeneintrag fr das PDF
 * erzeugt.//from   ww w .j  a  va  2  s . c o m
 * 
 * @param childs
 *            Kindelemente
 * @param schemaQueues
 *            Queues mit allen Elementen fr die einzelnen Schemas
 * @param strBullet
 *            Zeichen, das als Aufzhlunsgzeichen fr die Liste verwendet
 *            wird
 * @return PDF-Liste mit den Kindelementen
 */
private List erzeugeListeFuerKindElemente(XSParticle[] childs, Map<String, Queue<XSElementDecl>> schemaQueues,
        String strBullet) {

    List currList = new List(false, 12);
    currList.setListSymbol(strBullet);

    for (XSParticle currChild : childs) {

        if (currChild.getTerm() instanceof ElementDecl) {
            // Elemente von sequence bzw. choice abarbeiten
            XSElementDecl currElement = currChild.getTerm().asElementDecl();

            Phrase currPhrase = new Phrase();

            // Name, inkl. Referenz auf das Element
            currPhrase.add(getChunkTextBoldWithReference(getNameWithPrefix(currElement),
                    getReferenceForElement(currElement)));

            // Auftreten (direkt hinter dem Namen)
            currPhrase.add(getChunkText(" (" + getMinMaxStr(currChild) + ")\n"));

            // Beschreibung
            XSAnnotation currAnn = currChild.getAnnotation();
            if ((currAnn == null) && currElement.isLocal() && (currElement.getAnnotation() != null)) {
                currAnn = currElement.getAnnotation();
            }
            if (currAnn != null) {
                currPhrase.add(getChunkTextItalic(currAnn.getAnnotation().toString() + "\n"));
            }

            currList.add(new ListItem(currPhrase));

            // Element in Queue einfgen
            String currPrefix = getNsPref(currElement.getTargetNamespace());
            schemaQueues.get(currPrefix).add(currElement);

        } else if (currChild.getTerm() instanceof XSModelGroup) {
            // Element von sequence/choice kann wieder eine ModelGroup
            // (sequence/choice) sein
            XSModelGroup mg = currChild.getTerm().asModelGroup();
            XSParticle[] childChilds = mg.getChildren();
            if ((childChilds != null) && (childChilds.length > 0)) {

                // Art der Gruppe
                String strCompositor = "";
                Compositor compositor = mg.getCompositor();
                if (compositor.equals(com.sun.xml.xsom.XSModelGroup.Compositor.SEQUENCE)) {
                    strCompositor = "Sequence:";
                } else if (compositor.equals(com.sun.xml.xsom.XSModelGroup.Compositor.CHOICE)) {
                    strCompositor = "Choice:";
                }
                currList.add(new ListItem(getPhraseTextBold(strCompositor)));

                // neue Liste fr aktuelle Kindelemente erzeugen
                List subList = erzeugeListeFuerKindElemente(childChilds, schemaQueues, bulletSub);

                // Als Subliste hinzufgen
                currList.add(subList);
            }

        } else if (currChild.getTerm() instanceof XSWildcard) {
            // Element von sequence/choice kann ein Wildcard-Objekt sein,
            // z.B. 'xs:any'
            XSWildcard wildCard = currChild.getTerm().asWildcard();
            String currNamespaceStr = wildCard.apply(MySchemaWriter.WILDCARD_NS);

            Phrase currPhrase = new Phrase();
            currPhrase.add(getChunkTextBold("any"));
            currPhrase.add(getChunkText(" (" + getMinMaxStr(currChild) + ")\n"));
            if (currNamespaceStr.length() > 0) {
                currPhrase.add(getChunkText(currNamespaceStr));
            }
            currList.add(new ListItem(currPhrase));
        }
    }
    return currList;
}

From source file:de.extra.xtt.util.pdf.PdfCreatorImpl.java

License:Apache License

/**
 * Fr die Attribute des aktuellen Typs wird eine Liste erzeugt und der
 * angegebenen Sektion hinzugefgt.//w w  w  .  j  a  va  2 s  .  c om
 * 
 * @param currType
 *            Schemtyp, fr den die Attribute bestimmt werden
 * @param currSection
 *            Aktuelle Sektion des PDF-Dokuments
 */
private void behandleAttribute(XSType currType, Section currSection) {
    if (currType.isComplexType()) {
        @SuppressWarnings("unchecked")
        Iterator<XSAttGroupDecl> itr1 = (Iterator<XSAttGroupDecl>) currType.asComplexType().iterateAttGroups();
        @SuppressWarnings("unchecked")
        Iterator<XSAttributeUse> itr2 = (Iterator<XSAttributeUse>) currType.asComplexType()
                .iterateAttributeUses();

        if (itr1.hasNext() || itr2.hasNext()) {
            // Abstand
            currSection.add(getEmptyLineTextHalf());

            currSection.add(getParagraphTextBold("Attribute:"));

            List currList = new List(false, 12);
            currList.setListSymbol(bulletMain);

            while (itr1.hasNext()) {
                XSAttGroupDecl currAttr = itr1.next();
                String strAttribute = currAttr.getName();
                currList.add(new ListItem(getPhraseText(strAttribute)));
            }

            while (itr2.hasNext()) {
                XSAttributeDecl currAttr = itr2.next().getDecl();
                String strAttribute = currAttr.getName();
                // Typ kann lokal sein
                if (!currAttr.getType().isLocal()) {
                    strAttribute += " (" + getNameWithPrefix(currAttr.getType()) + ")";
                }
                currList.add(new ListItem(getPhraseText(strAttribute)));
            }
            currSection.add(currList);
        }
    }
}

From source file: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() + "%");
                    }/* w  w  w. j  a v  a2s.  c  o 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 ww .ja  v a  2s  .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 av  a  2s .  c  o m
            ListItem item = new ListItem();
            currentList.add(item);
            parseAndAddBodyTextLineToParagraph(item, line.substring(2), freeTextFont);
        } else {
            if (currentList != null && !currentList.isEmpty()) {
                currentList.getLastItem().setSpacingAfter(5);
                currentList.getFirstItem().setSpacingBefore(5);
                document.add(currentList);
                currentList = null;
            }
            Paragraph p = new Paragraph();
            p.setSpacingAfter(5);
            p.setSpacingBefore(5);
            parseAndAddBodyTextLineToParagraph(p, line, freeTextFont);
            document.add(p);
        }
    }
}

From source file:gov.utah.dts.det.ccl.actions.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  ww.  j  a v a  2  s.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.LivescanAuthorization.java

private static void generateDocumentPage2(TrackingRecordScreeningLetter screeningLetter, Document document,
        PdfWriter writer) throws BadElementException, DocumentException, Exception {
    Paragraph paragraph = null;//from  w ww .ja  v  a  2  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);
}

From source file:gov.utah.dts.det.ccl.actions.trackingrecordscreening.letters.reports.LivescanAuthorizationB1591.java

private static void generateDocumentPage2(TrackingRecordScreeningLetter screeningLetter, Document document,
        PdfWriter writer) throws BadElementException, DocumentException, Exception {
    Paragraph paragraph = null;/*from  w w w .  j  a  v a 2 s.com*/
    PdfPTable datatable = null;
    List blist = null;
    ListItem item = null;
    SimpleDateFormat df = new SimpleDateFormat("MM/dd/yyyy");
    StringBuilder sb;

    addLetterIdentifier(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));
    sb = new StringBuilder();
    sb.append("Director, ");
    if (screeningLetter.getTrackingRecordScreening().getFacility() != null
            && StringUtils.isNotBlank(screeningLetter.getTrackingRecordScreening().getFacility().getName())) {
        sb.append(screeningLetter.getTrackingRecordScreening().getFacility().getName().toUpperCase());
    }
    datatable.addCell(new Phrase(sb.toString(), mediumfont));
    datatable.setSpacingBefore(pageSeparatorSpace);
    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(pageSeparatorSpace);
    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(pageSeparatorSpace);
    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(pageSeparatorSpace);
    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(pageSeparatorSpace);
    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(pageSeparatorSpace);
    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(pageSeparatorSpace);
    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(pageSeparatorSpace);
    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);
}