Example usage for com.itextpdf.text List add

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

Introduction

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

Prototype

public boolean add(final Element o) 

Source Link

Document

Adds an Element to the List.

Usage

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

private static void generateDocumentPage1(TrackingRecordScreeningLetter screeningLetter, Document document,
        PdfWriter writer) throws BadElementException, DocumentException, Exception {
    PdfPTable table = null;//from w w  w  . j  a va  2 s.  c o  m
    int headerwidths[] = {};
    Paragraph paragraph = null;
    List blist = null;
    ListItem item = null;
    ListItem subItem = null;
    SimpleDateFormat df = new SimpleDateFormat("MM/dd/yyyy");
    StringBuilder sb;
    PdfContentByte over = writer.getDirectContent();

    // LS Authorization Letter Page 1
    addLetterIdentifier(document);

    paragraph = new Paragraph(fixedLeadingLarge);
    paragraph.add(new Phrase("Office of Licensing Livescan Authorization", largefontB));
    paragraph.setAlignment(Element.ALIGN_CENTER);
    paragraph.setSpacingBefore(30.0f);
    document.add(paragraph);

    paragraph = new Paragraph(fixedLeadingLarge);
    paragraph.add(new Phrase(df.format(screeningLetter.getLetterDate()), mediumfontB));
    paragraph.setAlignment(Element.ALIGN_CENTER);
    document.add(paragraph);

    paragraph = new Paragraph(fixedLeadingMedium);
    paragraph.add(new Phrase("Office of Licensing Information", mediumfontBU));
    paragraph.setSpacingBefore(20.0f);
    document.add(paragraph);

    /*
     * Start of Office of Licensing Information generation
     */
    table = new PdfPTable(2);
    // format the table
    headerwidths = new int[] { 60, 40 }; // percentage
    table.setWidths(headerwidths); // percentage
    table.setWidthPercentage(100);
    table.setSpacingBefore(pageSeparatorSpace);
    table.getDefaultCell().setPadding(0);
    table.getDefaultCell().setBorder(Rectangle.NO_BORDER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_TOP);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
    paragraph = new Paragraph(fixedLeadingLarge);
    paragraph.add(new Phrase("TYPE OF TRANSACTION: NFUF", largefontB));
    paragraph.add(Chunk.NEWLINE);
    paragraph.add(new Phrase("REASON FINGERPRINTED: UCA 62A-2-120", largefontB));
    paragraph.add(Chunk.NEWLINE);
    paragraph.add(new Phrase("BILLING CODE: B1591", largefontB));
    table.addCell(paragraph);
    paragraph = new Paragraph(fixedLeadingSmall);
    Calendar cal = Calendar.getInstance();
    cal.setTime(screeningLetter.getLetterDate());
    cal.add(Calendar.DAY_OF_MONTH, 16);
    paragraph.add(new Phrase("This Authorization Expires: " + df.format(cal.getTime()), smallfont));
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    table.addCell(paragraph);
    document.add(table);

    // Add Fee information
    paragraph = new Paragraph(fixedLeadingSmall);
    if (screeningLetter.getTrackingRecordScreening().getTrsDpsFbi() != null
            && screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getScanFee() != null) {
        paragraph.add(new Phrase("Scan Fee = ", smallfont));
        paragraph
                .add(new Phrase(
                        CommonUtils.fromDoubleToCurrency(
                                screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getScanFee()),
                        smallfontB));
    } else {
        paragraph.add(new Phrase("Search Fee = ", smallfont));
        if (screeningLetter.getTrackingRecordScreening().getTrsDpsFbi() != null
                && screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getSearchFee() != null) {
            paragraph.add(new Phrase(
                    CommonUtils.fromDoubleToCurrency(
                            screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getSearchFee()),
                    smallfontB));
        } else {
            paragraph.add(SMALL_BLANK);
        }
    }
    paragraph.setSpacingBefore(pageSeparatorSpace);
    document.add(paragraph);

    // Add Authorized Signature line
    paragraph = new Paragraph(fixedLeadingSmall);
    paragraph.add(new Phrase(
            "Office of Licensing Authorized Signature ___________________________________________________  Date ________________",
            smallfont));
    paragraph.setSpacingBefore(18.0f);
    document.add(paragraph);

    // Stamp the document date over the Date line above
    // NOTE: Use showColumnBorders as a diagnostic to display borders of column where date will be placed on document.
    //showColumnBorders(over);
    ColumnText ct = new ColumnText(over);
    ct.setLeading(fixedLeadingSmall);
    ct.addText(new Phrase(df.format(screeningLetter.getLetterDate()), smallfont));
    // Write column to document
    ct.setAlignment(Element.ALIGN_CENTER);
    ct.setSimpleColumn(COLUMNS[0][0], COLUMNS[0][1], COLUMNS[0][2], COLUMNS[0][3]);
    ct.go();

    over.setLineWidth(3.0f);
    over.setCMYKColorStroke(166, 92, 0, 145);
    over.moveTo(document.getPageSize().getLeft(65), BOTTOM_SEPARATOR_EDGE);
    over.lineTo(document.getPageSize().getRight(65), BOTTOM_SEPARATOR_EDGE);
    over.stroke();

    // Add Program & Applicatant header line
    paragraph = new Paragraph(fixedLeadingSmall);
    paragraph.add(new Phrase("Program & Applicant Information and Instructions", smallfontBU));
    paragraph.setSpacingBefore((2 * pageSeparatorSpace) + fixedLeadingSmall);
    document.add(paragraph);

    /*
     * Start of Applicant information line generation
     */
    table = new PdfPTable(3);
    // format the table
    headerwidths = new int[] { 43, 20, 37 }; // percentage
    table.setWidths(headerwidths); // percentage
    table.setWidthPercentage(100);
    table.setSpacingBefore(pageSeparatorSpace);
    table.getDefaultCell().setPadding(0);
    table.getDefaultCell().setBorder(Rectangle.NO_BORDER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_TOP);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_MIDDLE);

    // Add Applicant name
    paragraph = new Paragraph(fixedLeadingSmall);
    paragraph.add(new Phrase("Applicant: ", smallfontB));
    if (screeningLetter.getTrackingRecordScreening().getPerson() != null
            && StringUtils.isNotBlank(screeningLetter.getTrackingRecordScreening().getFirstAndLastName())) {
        paragraph.add(
                new Phrase(screeningLetter.getTrackingRecordScreening().getFirstAndLastName(), smallfontB));
    }
    table.addCell(paragraph);

    // Add Applicant ID
    paragraph = new Paragraph(fixedLeadingSmall);
    paragraph.add(new Phrase("ID: ", smallfontB));
    if (StringUtils.isNotBlank(screeningLetter.getTrackingRecordScreening().getPersonIdentifier())) {
        paragraph.add(
                new Phrase(screeningLetter.getTrackingRecordScreening().getPersonIdentifier(), smallfontB));
    }
    table.addCell(paragraph);

    // Add DOB information
    paragraph = new Paragraph(fixedLeadingSmall);
    paragraph.add(new Phrase("DOB: ", smallfontB));
    try {
        paragraph.add(
                new Phrase(df.format(screeningLetter.getTrackingRecordScreening().getBirthday()), smallfontB));
    } catch (NullPointerException e) {

    }
    table.addCell(paragraph);
    // Add Applicant Information Line Table to document
    document.add(table);
    /*
     * End of Applicant information line generation
     */

    // Add Application program line
    paragraph = new Paragraph(fixedLeadingSmall);
    sb = new StringBuilder();
    sb.append("Applicant Program: ");
    if (screeningLetter.getTrackingRecordScreening().getFacility() != null
            && StringUtils.isNotBlank(screeningLetter.getTrackingRecordScreening().getFacility().getName())) {
        sb.append(screeningLetter.getTrackingRecordScreening().getFacility().getName().toUpperCase());
    }
    paragraph.add(new Phrase(sb.toString(), smallfontB));
    paragraph.setSpacingBefore(pageSeparatorSpace);
    document.add(paragraph);

    // Add Payment information line
    paragraph = new Paragraph(fixedLeadingSmall);
    sb = new StringBuilder();
    sb.append("Payment issued by: ");
    if (screeningLetter.getTrackingRecordScreening().getTrsDpsFbi() != null && StringUtils
            .isNotBlank(screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getIssuedBy())) {
        sb.append(screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getIssuedBy().toUpperCase());
    }
    sb.append("    ");
    sb.append("Check Number: ");
    if (screeningLetter.getTrackingRecordScreening().getTrsDpsFbi() != null && StringUtils
            .isNotBlank(screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getMoNumber())) {
        sb.append(screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getMoNumber().toUpperCase());
    }
    paragraph.add(new Phrase(sb.toString(), smallfontB));
    paragraph.setSpacingBefore(pageSeparatorSpace);
    document.add(paragraph);

    // Add READ THIS CAREFULLY
    paragraph = new Paragraph(fixedLeadingMedium);
    paragraph.add(new Phrase("READ THIS CAREFULLY", largefontBU));
    paragraph.setAlignment(Element.ALIGN_CENTER);
    paragraph.setSpacingBefore(pageSeparatorSpace + fixedLeadingLarge);
    document.add(paragraph);

    /*
     * Start of instructions list section
     */
    blist = new List(false, 20);
    item = new ListItem(fixedLeadingSmall);
    item.setListSymbol(new Chunk("1.", mediumfont));
    item.add(new Phrase(
            "The Office of Licensing authorizes the applicant to submit her/his fingerprints for an electronic applicant background check ",
            smallfont));
    item.add(new Phrase(
            "at various sites throughout Utah using the Live Scan system. Each site charges a fee for the electronic fingerprint scan. ",
            smallfont));
    item.add(new Phrase(
            "Scanning fees vary from site to site. This is a separate fee from the one submitted to the Department of Human Services for ",
            smallfont));
    item.add(new Phrase("the actual criminal background search.", smallfont));
    item.setSpacingBefore(page1ListSpace);
    blist.add(item);

    item = new ListItem(fixedLeadingSmall);
    item.setListSymbol(new Chunk("2.", mediumfont));
    item.add(new Phrase(
            "Complete electronic fingerprint submission within 15 days of the date of this authorization letter. If unused, ",
            smallfontB));
    item.add(new Phrase(
            "requests for refunds will not be considered after 30 days. Refund requests require a letter of explanation ",
            smallfontB));
    item.add(new Phrase(
            "from the licensed program accompanied by this original authorization letter. Failure to complete electronic ",
            smallfontB));
    item.add(new Phrase(
            "fingerprint submission within this time will result in the denial of the background screening clearance and ",
            smallfontB));
    item.add(new Phrase(
            "the applicant will not be permitted to have direct access to children or vulnerable adults, will not be eligible ",
            smallfontB));
    item.add(new Phrase(
            "to provide services to programs licensed by the Utah Department of Human Services, Office of Licensing, and will not be ",
            smallfontB));
    item.add(new Phrase("eligible to proceed with foster care or adoption.", smallfontB));
    item.setSpacingBefore(4.0f);
    blist.add(item);

    item = new ListItem(fixedLeadingSmall);
    item.setListSymbol(new Chunk("3.", mediumfont));
    paragraph = new Paragraph(fixedLeadingSmall);
    paragraph.add(new Phrase("You will need to take with you:", smallfont));
    item.add(paragraph);
    List subList = new List(false, 10);
    subList.setIndentationLeft(10);
    subItem = new ListItem(fixedLeadingSmall);
    subItem.add(new Phrase("This original letter. Photocopies and facsimile (FAX) copies will not be accepted.",
            smallfont));
    subList.add(subItem);
    subItem = new ListItem(fixedLeadingSmall);
    subItem.add(new Phrase(
            "Photo I.D. in the form of your driver license or state identification card issued by the Division of Motor Vehicles.",
            smallfont));
    subList.add(subItem);
    subItem = new ListItem(fixedLeadingSmall);
    subItem.add(
            new Phrase("Cash or check as required (see site list for acceptable form of payment).", smallfont));
    subList.add(subItem);
    item.add(subList);
    item.setSpacingBefore(page1ListSpace);
    blist.add(item);

    item = new ListItem(fixedLeadingSmall);
    item.setListSymbol(new Chunk("4.", mediumfont));
    item.add(new Phrase(
            "If the electronically submitted fingerprints are rejected, the Office of Licensing will notify the applicant/licensed program ",
            smallfont));
    item.add(new Phrase("of additional instructions for completing the nationwide background search.",
            smallfont));
    item.setSpacingBefore(page1ListSpace);
    blist.add(item);

    item = new ListItem(fixedLeadingSmall);
    item.setListSymbol(new Chunk("5.", mediumfont));
    item.add(new Phrase(
            "Applicant Signature ___________________________________________________  Date ________________",
            smallfont));
    item.setSpacingBefore(page1ListSpace);
    blist.add(item);
    document.add(blist);
    /*
     * End of instructions list section
     */

    paragraph = new Paragraph();
    paragraph.add(new Phrase(
            "A current list of Livescan sites is available at www.hslic.utah.gov/docs/livescan sites.pdf",
            smallfont));
    paragraph.setAlignment(Element.ALIGN_CENTER);
    paragraph.setSpacingBefore(pageSeparatorSpace);
    document.add(paragraph);

    paragraph = new Paragraph(fixedLeadingMedium);
    paragraph.add(new Phrase("Live Scan Operator: Keep this original for auditing purposes.", mediumfontB));
    paragraph.setAlignment(Element.ALIGN_CENTER);
    paragraph.setSpacingBefore(pageSeparatorSpace);
    document.add(paragraph);
}

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;//  www  .j a v  a  2  s . c  om
    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);
}

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

private static void generateDocumentPage1(TrackingRecordScreeningLetter screeningLetter, Document document,
        PdfWriter writer) throws BadElementException, DocumentException, Exception {
    PdfPTable table = null;//from www  . j a  v  a  2  s .c o  m
    int headerwidths[] = {};
    Paragraph paragraph = null;
    List blist = null;
    ListItem item = null;
    ListItem subItem = null;
    SimpleDateFormat df = new SimpleDateFormat("MM/dd/yyyy");
    StringBuilder sb;
    PdfContentByte over = writer.getDirectContent();

    // LS Authorization Letter Page 1
    addLetterIdentifier(document);

    paragraph = new Paragraph(fixedLeadingLarge);
    paragraph.add(new Phrase("Office of Licensing Livescan Authorization", largefontB));
    paragraph.setAlignment(Element.ALIGN_CENTER);
    paragraph.setSpacingBefore(30.0f);
    document.add(paragraph);

    paragraph = new Paragraph(fixedLeadingLarge);
    paragraph.add(new Phrase(df.format(screeningLetter.getLetterDate()), mediumfontB));
    paragraph.setAlignment(Element.ALIGN_CENTER);
    document.add(paragraph);

    paragraph = new Paragraph(fixedLeadingMedium);
    paragraph.add(new Phrase("Office of Licensing Information", mediumfontBU));
    paragraph.setSpacingBefore(20.0f);
    document.add(paragraph);

    /*
     * Start of Office of Licensing Information generation
     */
    table = new PdfPTable(2);
    // format the table
    headerwidths = new int[] { 60, 40 }; // percentage
    table.setWidths(headerwidths); // percentage
    table.setWidthPercentage(100);
    table.setSpacingBefore(pageSeparatorSpace);
    table.getDefaultCell().setPadding(0);
    table.getDefaultCell().setBorder(Rectangle.NO_BORDER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_TOP);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
    paragraph = new Paragraph(fixedLeadingLarge);
    paragraph.add(new Phrase("TYPE OF TRANSACTION: FANC", largefontB));
    paragraph.add(Chunk.NEWLINE);
    paragraph.add(new Phrase("REASON FINGERPRINTED: UCA 53-10-108", largefontB));
    paragraph.add(Chunk.NEWLINE);
    paragraph.add(new Phrase("BILLING CODE: B1606", largefontB));
    table.addCell(paragraph);
    paragraph = new Paragraph(fixedLeadingSmall);
    Calendar cal = Calendar.getInstance();
    cal.setTime(screeningLetter.getLetterDate());
    cal.add(Calendar.DAY_OF_MONTH, 16);
    paragraph.add(new Phrase("This Authorization Expires: " + df.format(cal.getTime()), smallfont));
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    table.addCell(paragraph);
    document.add(table);

    // Add Fee information
    paragraph = new Paragraph(fixedLeadingSmall);
    if (screeningLetter.getTrackingRecordScreening().getTrsDpsFbi() != null
            && screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getScanFee() != null) {
        paragraph.add(new Phrase("Scan Fee = ", smallfont));
        paragraph
                .add(new Phrase(
                        CommonUtils.fromDoubleToCurrency(
                                screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getScanFee()),
                        smallfontB));
    } else {
        paragraph.add(new Phrase("Search Fee = ", smallfont));
        if (screeningLetter.getTrackingRecordScreening().getTrsDpsFbi() != null
                && screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getSearchFee() != null) {
            paragraph.add(new Phrase(
                    CommonUtils.fromDoubleToCurrency(
                            screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getSearchFee()),
                    smallfontB));
        } else {
            paragraph.add(SMALL_BLANK);
        }
    }
    paragraph.setSpacingBefore(pageSeparatorSpace);
    document.add(paragraph);

    // Add Authorized Signature line
    paragraph = new Paragraph(fixedLeadingSmall);
    paragraph.add(new Phrase(
            "Office of Licensing Authorized Signature ___________________________________________________  Date ________________",
            smallfont));
    paragraph.setSpacingBefore(18.0f);
    document.add(paragraph);

    // Stamp the document date over the Date line above
    // NOTE: Use showColumnBorders as a diagnostic to display borders of column where date will be placed on document.
    //showColumnBorders(over);
    ColumnText ct = new ColumnText(over);
    ct.setLeading(fixedLeadingSmall);
    ct.addText(new Phrase(df.format(screeningLetter.getLetterDate()), smallfont));
    // Write column to document
    ct.setAlignment(Element.ALIGN_CENTER);
    ct.setSimpleColumn(COLUMNS[0][0], COLUMNS[0][1], COLUMNS[0][2], COLUMNS[0][3]);
    ct.go();

    over.setLineWidth(3.0f);
    over.setCMYKColorStroke(166, 92, 0, 145);
    over.moveTo(document.getPageSize().getLeft(65), BOTTOM_SEPARATOR_EDGE);
    over.lineTo(document.getPageSize().getRight(65), BOTTOM_SEPARATOR_EDGE);
    over.stroke();

    // Add Program & Applicatant header line
    paragraph = new Paragraph(fixedLeadingSmall);
    paragraph.add(new Phrase("Program & Applicant Information and Instructions", smallfontBU));
    paragraph.setSpacingBefore((2 * pageSeparatorSpace) + fixedLeadingSmall);
    document.add(paragraph);

    /*
     * Start of Applicant information line generation
     */
    table = new PdfPTable(3);
    // format the table
    headerwidths = new int[] { 43, 20, 37 }; // percentage
    table.setWidths(headerwidths); // percentage
    table.setWidthPercentage(100);
    table.setSpacingBefore(pageSeparatorSpace);
    table.getDefaultCell().setPadding(0);
    table.getDefaultCell().setBorder(Rectangle.NO_BORDER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_TOP);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_MIDDLE);

    // Add Applicant name
    paragraph = new Paragraph(fixedLeadingSmall);
    paragraph.add(new Phrase("Applicant: ", smallfontB));
    if (screeningLetter.getTrackingRecordScreening().getPerson() != null
            && StringUtils.isNotBlank(screeningLetter.getTrackingRecordScreening().getFirstAndLastName())) {
        paragraph.add(
                new Phrase(screeningLetter.getTrackingRecordScreening().getFirstAndLastName(), smallfontB));
    }
    table.addCell(paragraph);

    // Add Applicant ID
    paragraph = new Paragraph(fixedLeadingSmall);
    paragraph.add(new Phrase("ID: ", smallfontB));
    if (StringUtils.isNotBlank(screeningLetter.getTrackingRecordScreening().getPersonIdentifier())) {
        paragraph.add(
                new Phrase(screeningLetter.getTrackingRecordScreening().getPersonIdentifier(), smallfontB));
    }
    table.addCell(paragraph);

    // Add DOB information
    paragraph = new Paragraph(fixedLeadingSmall);
    paragraph.add(new Phrase("DOB: ", smallfontB));
    try {
        paragraph.add(
                new Phrase(df.format(screeningLetter.getTrackingRecordScreening().getBirthday()), smallfontB));
    } catch (NullPointerException e) {

    }
    table.addCell(paragraph);
    // Add Applicant Information Line Table to document
    document.add(table);
    /*
     * End of Applicant information line generation
     */

    // Add Application program line
    paragraph = new Paragraph(fixedLeadingSmall);
    sb = new StringBuilder();
    sb.append("Applicant Program: ");
    if (screeningLetter.getTrackingRecordScreening().getFacility() != null
            && StringUtils.isNotBlank(screeningLetter.getTrackingRecordScreening().getFacility().getName())) {
        sb.append(screeningLetter.getTrackingRecordScreening().getFacility().getName().toUpperCase());
    }
    paragraph.add(new Phrase(sb.toString(), smallfontB));
    paragraph.setSpacingBefore(pageSeparatorSpace);
    document.add(paragraph);

    // Add Payment information line
    paragraph = new Paragraph(fixedLeadingSmall);
    sb = new StringBuilder();
    sb.append("Payment issued by: ");
    if (screeningLetter.getTrackingRecordScreening().getTrsDpsFbi() != null && StringUtils
            .isNotBlank(screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getIssuedBy())) {
        sb.append(screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getIssuedBy().toUpperCase());
    }
    sb.append("    ");
    sb.append("Check Number: ");
    if (screeningLetter.getTrackingRecordScreening().getTrsDpsFbi() != null && StringUtils
            .isNotBlank(screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getMoNumber())) {
        sb.append(screeningLetter.getTrackingRecordScreening().getTrsDpsFbi().getMoNumber().toUpperCase());
    }
    paragraph.add(new Phrase(sb.toString(), smallfontB));
    paragraph.setSpacingBefore(pageSeparatorSpace);
    document.add(paragraph);

    // Add READ THIS CAREFULLY
    paragraph = new Paragraph(fixedLeadingMedium);
    paragraph.add(new Phrase("READ THIS CAREFULLY", largefontBU));
    paragraph.setAlignment(Element.ALIGN_CENTER);
    paragraph.setSpacingBefore(pageSeparatorSpace + fixedLeadingLarge);
    document.add(paragraph);

    /*
     * Start of instructions list section
     */
    blist = new List(false, 20);
    item = new ListItem(fixedLeadingSmall);
    item.setListSymbol(new Chunk("1.", mediumfont));
    item.add(new Phrase(
            "The Office of Licensing authorizes the applicant to submit her/his fingerprints for an electronic applicant background check ",
            smallfont));
    item.add(new Phrase(
            "at various sites throughout Utah using the Live Scan system. Each site charges a fee for the electronic fingerprint scan. ",
            smallfont));
    item.add(new Phrase(
            "Scanning fees vary from site to site. This is a separate fee from the one submitted to the Department of Human Services for ",
            smallfont));
    item.add(new Phrase("the actual criminal background search.", smallfont));
    item.setSpacingBefore(page1ListSpace);
    blist.add(item);

    item = new ListItem(fixedLeadingSmall);
    item.setListSymbol(new Chunk("2.", mediumfont));
    item.add(new Phrase(
            "Complete electronic fingerprint submission within 15 days of the date of this authorization letter. If unused, ",
            smallfontB));
    item.add(new Phrase(
            "requests for refunds will not be considered after 30 days. Refund requests require a letter of explanation ",
            smallfontB));
    item.add(new Phrase(
            "from the licensed program accompanied by this original authorization letter. Failure to complete electronic ",
            smallfontB));
    item.add(new Phrase(
            "fingerprint submission within this time will result in the denial of the background screening clearance and ",
            smallfontB));
    item.add(new Phrase(
            "the applicant will not be permitted to have direct access to children or vulnerable adults, will not be eligible ",
            smallfontB));
    item.add(new Phrase(
            "to provide services to programs licensed by the Utah Department of Human Services, Office of Licensing, and will not be ",
            smallfontB));
    item.add(new Phrase("eligible to proceed with foster care or adoption.", smallfontB));
    item.setSpacingBefore(4.0f);
    blist.add(item);

    item = new ListItem(fixedLeadingSmall);
    item.setListSymbol(new Chunk("3.", mediumfont));
    paragraph = new Paragraph(fixedLeadingSmall);
    paragraph.add(new Phrase("You will need to take with you:", smallfont));
    item.add(paragraph);
    List subList = new List(false, 10);
    subList.setIndentationLeft(10);
    subItem = new ListItem(fixedLeadingSmall);
    subItem.add(new Phrase("This original letter. Photocopies and facsimile (FAX) copies will not be accepted.",
            smallfont));
    subList.add(subItem);
    subItem = new ListItem(fixedLeadingSmall);
    subItem.add(new Phrase(
            "Photo I.D. in the form of your driver license or state identification card issued by the Division of Motor Vehicles.",
            smallfont));
    subList.add(subItem);
    subItem = new ListItem(fixedLeadingSmall);
    subItem.add(
            new Phrase("Cash or check as required (see site list for acceptable form of payment).", smallfont));
    subList.add(subItem);
    item.add(subList);
    item.setSpacingBefore(page1ListSpace);
    blist.add(item);

    item = new ListItem(fixedLeadingSmall);
    item.setListSymbol(new Chunk("4.", mediumfont));
    item.add(new Phrase(
            "If the electronically submitted fingerprints are rejected, the Office of Licensing will notify the applicant/licensed program ",
            smallfont));
    item.add(new Phrase("of additional instructions for completing the nationwide background search.",
            smallfont));
    item.setSpacingBefore(page1ListSpace);
    blist.add(item);

    item = new ListItem(fixedLeadingSmall);
    item.setListSymbol(new Chunk("5.", mediumfont));
    item.add(new Phrase(
            "Applicant Signature ___________________________________________________  Date ________________",
            smallfont));
    item.setSpacingBefore(page1ListSpace);
    blist.add(item);
    document.add(blist);
    /*
     * End of instructions list section
     */

    paragraph = new Paragraph();
    paragraph.add(new Phrase(
            "A current list of Livescan sites is available at www.hslic.utah.gov/docs/livescan sites.pdf",
            smallfont));
    paragraph.setAlignment(Element.ALIGN_CENTER);
    paragraph.setSpacingBefore(pageSeparatorSpace);
    document.add(paragraph);

    paragraph = new Paragraph(fixedLeadingMedium);
    paragraph.add(new Phrase("Live Scan Operator: Keep this original for auditing purposes.", mediumfontB));
    paragraph.setAlignment(Element.ALIGN_CENTER);
    paragraph.setSpacingBefore(pageSeparatorSpace);
    document.add(paragraph);
}

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

private static void writePdf(TrackingRecordScreeningLetter screeningLetter, OutputStream ba,
        HttpServletRequest request) throws DocumentException, BadElementException, IOException {
    Document document = null;//from w w w.  j  a  va  2s. c o  m
    Paragraph paragraph = null;
    ListItem item = null;
    document = new Document(PageSize.LETTER, 50, 50, 125, 0);
    PdfWriter writer = PdfWriter.getInstance(document, ba);
    StringBuilder sb = null;
    SimpleDateFormat df = new SimpleDateFormat("MMMM d, yyyy");

    document.open();

    LetterheadStamper.stampLetter(writer, request);

    paragraph = getParagraph(10.0f);
    paragraph.add(new Phrase("MSO FC", smallfont));
    paragraph.setIndentationLeft(415);
    document.add(paragraph);
    paragraph.clear();
    paragraph.add(new Phrase("Rev 3/12", smallfont));
    paragraph.setSpacingAfter(50);
    document.add(paragraph);

    // Add report date
    paragraph = getParagraph();
    paragraph.add(new Phrase(df.format(screeningLetter.getLetterDate()), mediumfont));
    paragraph.setIndentationLeft(350);
    document.add(paragraph);

    // Add applicant name and address information
    paragraph = getParagraph();
    paragraph.add(new Phrase(screeningLetter.getTrackingRecordScreening().getFirstAndLastName().toUpperCase(),
            mediumfont));
    paragraph.setSpacingBefore(5);
    document.add(paragraph);
    if (StringUtils.isNotBlank(screeningLetter.getAddress().getAddressOne())) {
        paragraph = getParagraph();
        paragraph.add(new Phrase(screeningLetter.getAddress().getAddressOne().toUpperCase(), mediumfont));
        document.add(paragraph);
    }
    if (StringUtils.isNotBlank(screeningLetter.getAddress().getAddressTwo())) {
        // Add facility location address two
        paragraph = getParagraph();
        paragraph.add(new Phrase(screeningLetter.getAddress().getAddressTwo().toUpperCase(), mediumfont));
        document.add(paragraph);
    }
    if (StringUtils.isNotBlank(screeningLetter.getAddress().getCityStateZip())) {
        paragraph = getParagraph();
        paragraph.add(new Phrase(screeningLetter.getAddress().getCityStateZip().toUpperCase(), mediumfont));
        document.add(paragraph);
    }

    // Add subject information
    paragraph = getParagraph();
    paragraph.add(new Phrase("RE: Notice of additional Criminal Background Screening information needed:",
            mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    // Add Screening Person's Name/ID
    paragraph = getParagraph(16.0f);
    paragraph.add(new Phrase(screeningLetter.getTrackingRecordScreening().getFirstAndLastName() + " ("
            + screeningLetter.getTrackingRecordScreening().getPersonIdentifier() + ")", mediumfont));
    // Indent this line to line up with 'Notice' in subject line
    paragraph.setIndentationLeft(22);
    document.add(paragraph);

    // Add salutation
    paragraph = getParagraph();
    paragraph.add(new Phrase("Dear " + screeningLetter.getTrackingRecordScreening().getFirstAndLastName() + ":",
            mediumfont));
    paragraph.setSpacingBefore(18);
    document.add(paragraph);

    // Start letter detail
    sb = new StringBuilder();
    sb.append(
            "As a follow-up to the request for background screening by the Department of Human Services, Office of Licensing, ");
    sb.append("this is to notify you that additional criminal background screening information is needed.");
    paragraph = getParagraph();
    paragraph.add(new Phrase(sb.toString(), mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    paragraph = getParagraph();
    paragraph.add(new Phrase(
            "Enclosed are two fingerprint cards for you to provide complete, accurate and legible identifying information. ",
            mediumfont));
    paragraph.add(new Phrase("Return the completed fingerprint cards with a $36.50 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 Resources, ", mediumfontI));
    paragraph.add(new Phrase(
            "to the Office of Licensing within 15 calendar days of your receipt of this notice.", mediumfont));
    paragraph.setSpacingBefore(10);
    paragraph.setSpacingAfter(10);
    document.add(paragraph);

    // Add the fingerprint card procedures as an indented bullet list
    List procedure = new List(false, 10);
    procedure.setIndentationLeft(10);
    item = getListItem();
    item.add(new Phrase(
            "Prints should be taken by a local law enforcement office, or an agency approved by law enforcement.",
            mediumfont));
    procedure.add(item);
    item = getListItem();
    item.add(new Phrase("The FBI will reject a card with any highlighting.", mediumfont));
    procedure.add(item);
    item = getListItem();
    item.add(new Phrase(
            "Use only these cards showing identification from the Office of Licensing. We will be glad to give you replacement cards if requested.",
            mediumfont));
    procedure.add(item);
    item = getListItem();
    procedure.add(new Phrase(
            "If mailing the cards back to us, return by regular mail (please do not fold the cards).",
            mediumfont));
    procedure.add(item);
    item = getListItem();
    item.add(new Phrase(
            "Fingerprint cards must be completely filled out or they will be returned for completion.",
            mediumfont));
    procedure.add(item);
    document.add(procedure);

    sb = new StringBuilder();
    sb.append(
            "Failure to return the completed fingerprint cards and fee within 15 calendar days will result in your background screening ");
    sb.append(
            "application being denied, and you will not be eligible to be associated with the licensed program in any capacity ");
    sb.append(
            "or will not be eligible to proceed with foster care or adoption until all clearance procedures are completed.");
    paragraph = getParagraph();
    paragraph.add(new Phrase(sb.toString(), mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    sb = new StringBuilder();
    sb.append(
            "Please allow up to 12 weeks for the completion of the clearance process. For assistance or inquiries, you can contact the Office of Licensing ");
    sb.append("at (801) 538-4242.");
    paragraph = getParagraph();
    paragraph.add(new Phrase(sb.toString(), 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("Background Screening Unit", 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.MultiStateOffenderLetterTX.java

private static void writePdf(TrackingRecordScreeningLetter screeningLetter, OutputStream ba,
        HttpServletRequest request) throws DocumentException, BadElementException, IOException {
    Document document = null;/*from  w  w w.  j a  v  a2  s  .c om*/
    Paragraph paragraph = null;
    ListItem item = null;
    document = new Document(PageSize.LETTER, 50, 50, 125, 0);
    PdfWriter writer = PdfWriter.getInstance(document, ba);
    StringBuilder sb = null;
    SimpleDateFormat df = new SimpleDateFormat("MMMM d, yyyy");

    document.open();

    LetterheadStamper.stampLetter(writer, request);

    paragraph = getParagraph(10.0f);
    paragraph.add(new Phrase("MSO TX", smallfont));
    paragraph.setIndentationLeft(415);
    document.add(paragraph);
    paragraph.clear();
    paragraph.add(new Phrase("Rev 3/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 additional Criminal Background Screening information needed:",
            mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    // Add Screening Person's Name/ID
    sb = new StringBuilder();
    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
    sb = new StringBuilder();
    sb.append(
            "As a follow-up to the request for background screening by the Department of Human Services, Office of Licensing, ");
    sb.append("this is to notify you that additional criminal background screening information is needed.");
    paragraph = getParagraph();
    paragraph.add(new Phrase(sb.toString(), mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    paragraph = getParagraph();
    paragraph.add(new Phrase(
            "Enclosed are two fingerprint cards for the applicant to provide complete, accurate and legible identifying information. ",
            mediumfont));
    paragraph.add(new Phrase("Return the completed fingerprint cards with a $36.50 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 Resources, ", mediumfontI));
    paragraph.add(new Phrase(
            "to the Office of Licensing within 15 calendar days of your receipt of this notice. Do not put multiple fingerprints ",
            mediumfont));
    paragraph.add(new Phrase("with one payment, unless for a couple with the same last name.", mediumfont));
    paragraph.setSpacingBefore(10);
    paragraph.setSpacingAfter(10);
    document.add(paragraph);

    // Add the fingerprint card procedures as an indented bullet list
    List procedure = new List(false, 10);
    procedure.setIndentationLeft(22);
    item = getListItem();
    item.add(new Phrase(
            "Prints should be taken by a local law enforcement office, or an agency approved by law enforcement.",
            mediumfont));
    procedure.add(item);
    item = getListItem();
    item.add(new Phrase("The FBI will reject a card with any highlighting.", mediumfont));
    procedure.add(item);
    item = getListItem();
    item.add(new Phrase(
            "Use only these cards showing identification from the Office of Licensing. We will be glad to give you replacement cards if requested.",
            mediumfont));
    procedure.add(item);
    item = getListItem();
    item.add(new Phrase(
            "If mailing the cards back to us, return by regular mail (please do not fold the cards).",
            mediumfont));
    procedure.add(item);
    item = getListItem();
    item.add(new Phrase(
            "Fingerprint cards must be completely filled out or they will be returned for completion.",
            mediumfont));
    procedure.add(item);
    document.add(procedure);

    sb = new StringBuilder();
    sb.append(
            "Failure to return the completed fingerprint cards and fee within 15 calendar days will result in the background screening ");
    sb.append(
            "application being denied, and the applicant will not be eligible to be associated with the licensed program in any capacity ");
    sb.append(
            "or will not be eligible to proceed with foster care or adoption until all clearance procedures are completed.");
    paragraph = getParagraph();
    paragraph.add(new Phrase(sb.toString(), mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    sb = new StringBuilder();
    sb.append(
            "Please allow up to 12 weeks for the completion of the clearance process. For assistance or inquiries, please contact the Office of Licensing ");
    sb.append("at (801) 538-4242.");
    paragraph = getParagraph();
    paragraph.add(new Phrase(sb.toString(), mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    paragraph = new Paragraph();
    paragraph.add(new Phrase("Sincerely,", mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    paragraph = new Paragraph();
    paragraph.add(new Phrase(screeningLetter.getCreatedBy().getFirstAndLastName(), mediumfont));
    paragraph.setSpacingBefore(25);
    document.add(paragraph);

    paragraph = new Paragraph();
    paragraph.add(new Phrase("Background Screening Unit", mediumfont));
    document.add(paragraph);

    document.close();
}

From source file:jfx_horario.jefatura.JefaturaController.java

private void crearListaClasesDiariasPDF(Document document, Font fuente) throws DocumentException {
    if (lstHorario.getItems().size() > 0) {
        Paragraph clasesHoy = new Paragraph("Clases de hoy:", fuente);
        document.add(clasesHoy);/* www .  ja  va2s. c  o m*/
        document.add(new Paragraph(" "));

        List list = new List(List.UNORDERED);
        for (int i = 0; i < lstHorario.getItems().size(); i++) {
            ListItem item = new ListItem((String) lstHorario.getItems().get(i));
            item.setAlignment(Element.ALIGN_JUSTIFIED);
            list.add(item);
        }
        document.add(list);
    }
}

From source file:net.sf.timecult.export.pdf.PdfTaskListExporter.java

License:Open Source License

private static void createTaskList(Document doc, TaskStatus taskStatus, Class<Task> taskSubtype)
        throws DocumentException, IOException {
    String tag = "tasklist." + taskStatus.toString();
    if (taskStatus.getId() == TaskStatus.FLAGGED) {
        tag = taskStatus.getFlagColor().toString().toLowerCase() + "Flag";
    }//  w  w w.j a va 2  s . c om
    String titleText = ResourceHelper.getString("button." + tag + ".tooltip");
    Paragraph subTitle = new Paragraph(titleText, sectionFont);
    subTitle.setSpacingAfter(10);
    subTitle.setSpacingBefore(10);
    doc.add(subTitle);
    Task filteredTasks[] = TimeTracker.getInstance().getWorkspace().getTasksByStatus(taskStatus);
    TreeMap<String, Task> sortedItems = new TreeMap<String, Task>();
    for (int i = 0; i < filteredTasks.length; i++) {
        sortedItems.put(filteredTasks[i].toString(), filteredTasks[i]);
    }
    Collection<Task> tasks = sortedItems.values();
    com.itextpdf.text.List taskList = new List();
    for (Task task : tasks) {
        //
        // Add flagged items regardless of their subtype (task or activity)
        //
        if ((taskStatus.getId() == TaskStatus.FLAGGED && task.getStatus().getId() == TaskStatus.FLAGGED)
                || task.getClass().equals(taskSubtype)) {

            Paragraph namePar = new Paragraph(task.getName(), textFont);
            ListItem taskItem = new ListItem();
            taskItem.add(namePar);
            if (taskStatus.getId() == TaskStatus.WAITING) {
                Paragraph reasonPar = new Paragraph(task.getWaitReason().getText(), commentFont);
                taskItem.add(reasonPar);
            }
            taskList.add(taskItem);
        }
    }
    doc.add(taskList);
}

From source file:org.smap.sdal.managers.PDFSurveyManager.java

License:Open Source License

private void processSelect(Parser parser, String remoteUser, PdfPCell cell, DisplayItem di,
        boolean generateBlank, GlobalVariables gv, int oId) throws Exception {

    Font f = null;/*from  w w  w.ja  va2s.c  o m*/
    boolean isRtl = false;

    // If generating blank template
    List list = new List();
    list.setAutoindent(false);
    list.setSymbolIndent(24);

    String lang;

    boolean isSelectMultiple = di.type.equals("select") ? true : false;

    // Questions that append their values to this question
    ArrayList<String> deps = gv.addToList.get(di.fIdx + "_" + di.rec_number + "_" + di.name);

    /*
     * Add the value of this question unless
     *   The form is not blank and the value is "other" and their are 1 or more dependent questions
     *   In this case we assume that its only the values of the dependent questions that are needed
     */

    if (generateBlank) {
        // TODO get real choices using choice manager
        Form form = survey.forms.get(di.fIdx);
        Question question = form.questions.get(di.qIdx);
        OptionList ol = survey.optionLists.get(question.list_name);
        for (Option o : ol.options) {

            String text = null;
            if (o.display_name != null && o.display_name.trim().length() > 0) {
                text = o.display_name;
            } else {
                text = o.labels.get(languageIdx).text;
            }
            lang = GeneralUtilityMethods.getLanguage(text);
            f = getFont(lang);
            isRtl = isRtl(lang);

            ListItem item = new ListItem(GeneralUtilityMethods.unesc(text), f);

            if (isSelectMultiple) {
                item.setListSymbol(new Chunk("\uf096", Symbols));
                list.add(item);
            } else {
                item.setListSymbol(new Chunk("\uf10c", Symbols));
                list.add(item);
            }
        }

        if (isRtl) {
            cell.setRunDirection(PdfWriter.RUN_DIRECTION_RTL);
        }
        cell.addElement(list);

    } else {
        if (deps == null || (di.value != null && !di.value.trim().toLowerCase().equals("other"))) {

            String value = di.value;
            if (di.type.equals("select1")) {

                Form form = survey.forms.get(di.fIdx);
                Question question = form.questions.get(di.qIdx);

                ArrayList<String> matches = new ArrayList<String>();
                matches.add(di.value);
                value = choiceManager.getLabel(sd, cResults, user, oId, survey.id, question.id, question.l_id,
                        question.external_choices, question.external_table,
                        survey.languages.get(languageIdx).name, languageIdx, matches, survey.ident);
            } else if (di.type.equals("select")) {
                String nameValue = value;
                if (nameValue != null) {
                    String vArray[] = nameValue.split(" ");
                    ArrayList<String> matches = new ArrayList<String>();
                    if (vArray != null) {
                        for (String v : vArray) {
                            matches.add(v);
                        }
                    }
                    Form form = survey.forms.get(di.fIdx);
                    Question question = form.questions.get(di.qIdx);
                    value = choiceManager.getLabel(sd, cResults, user, oId, survey.id, question.id,
                            question.l_id, question.external_choices, question.external_table,
                            survey.languages.get(languageIdx).name, languageIdx, matches, survey.ident);
                }
            }

            if (GeneralUtilityMethods.isRtlLanguage(di.value)) {
                cell.setRunDirection(PdfWriter.RUN_DIRECTION_RTL);
            }
            parser.elements.clear();
            String html = getHtml(value, di, gv, deps);
            try {
                parser.xmlParser.parse(new StringReader(html));
            } catch (Exception e) {
                log.info("Error parsing: " + html.toString() + " : " + e.getMessage());
                lm.writeLog(sd, survey.getId(), remoteUser, LogManager.ERROR,
                        e.getMessage() + " for: " + html.toString());
                cell.addElement(getPara(html.toString(), di, gv, null, null));
            }
            for (Element element : parser.elements) {
                cell.addElement(element);
            }
            //cell.addElement(getPara(value, di, gv, deps, null));
        }

    }

}

From source file:org.tvd.thptty.management.report.Report.java

@SuppressWarnings("unused")
private void createList(Section subCatPart) {
    List list = new List(true, false, 10);
    list.add(new ListItem("First point"));
    list.add(new ListItem("Second point"));
    list.add(new ListItem("Third point"));
    subCatPart.add(list);/*from w w  w.  j a va 2s  .  c  o m*/
}

From source file:pdfgen.pdf_generation_try5.java

public void createList(Section subCatPart) {
    List list = new List(true, false, 10);
    list.add(new ListItem("First point"));
    list.add(new ListItem("Second point"));
    list.add(new ListItem("Third point"));
    subCatPart.add(list);//  w  w w .j a va2s. c  o m
}