Example usage for com.itextpdf.text PageSize LETTER

List of usage examples for com.itextpdf.text PageSize LETTER

Introduction

In this page you can find the example usage for com.itextpdf.text PageSize LETTER.

Prototype

Rectangle LETTER

To view the source code for com.itextpdf.text PageSize LETTER.

Click Source Link

Document

This is the letter format

Usage

From source file:gov.utah.dts.det.ccl.actions.reports.generators.LicenseRenewalLettersReport.java

public static ByteArrayOutputStream generate(java.util.List<FacilityLicenseView> licenses) {
    ByteArrayOutputStream ba = null;
    FacilityLicenseView license;//w  ww  .  j av a 2  s  . co m
    Document document = null;
    Date today = new Date();
    try {
        ba = new ByteArrayOutputStream();
        document = new Document(PageSize.LETTER, 75, 75, 175, 50);
        PdfWriter writer = PdfWriter.getInstance(document, ba);

        document.open();

        if (licenses != null && licenses.size() > 0) {
            for (int i = 0; i < licenses.size(); i++) {
                license = licenses.get(i);
                generateDocumentPage(license, today, document, writer);
                // If there is another letter to print add a new page to the document
                if (i < licenses.size() - 1) {
                    document.newPage();
                }
            }
        } else {
            Paragraph paragraph = new Paragraph(fixedLeading);
            paragraph.add(new Phrase("No renewal licenses were found to print.", mediumfont));
            document.add(paragraph);
        }

        document.close();
    } catch (Exception ex) {
        log.error(ex.getMessage());
        ba = null;
    }
    return ba;
}

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

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

    document.open();

    LetterheadStamper.stampLetter(writer, request);

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

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

    // Add facility name and address information
    paragraph = getParagraph();
    paragraph.add(new Phrase(screeningLetter.getTrackingRecordScreening().getFacility().getName().toUpperCase(),
            mediumfont));
    paragraph.setSpacingBefore(5);
    document.add(paragraph);

    if (screeningLetter.getTrackingRecordScreening().getFacility().getCbsAddress() != null) {
        if (StringUtils.isNotBlank(
                screeningLetter.getTrackingRecordScreening().getFacility().getCbsAddress().getAddressOne())) {
            paragraph = getParagraph();
            paragraph.add(new Phrase(screeningLetter.getTrackingRecordScreening().getFacility().getCbsAddress()
                    .getAddressOne().toUpperCase(), mediumfont));
            document.add(paragraph);
        }
        if (StringUtils.isNotBlank(
                screeningLetter.getTrackingRecordScreening().getFacility().getCbsAddress().getAddressTwo())) {
            // Add facility location address two
            paragraph = getParagraph();
            paragraph.add(new Phrase(screeningLetter.getTrackingRecordScreening().getFacility().getCbsAddress()
                    .getAddressTwo().toUpperCase(), mediumfont));
            document.add(paragraph);
        }
        if (StringUtils.isNotBlank(
                screeningLetter.getTrackingRecordScreening().getFacility().getCbsAddress().getCityStateZip())) {
            paragraph = getParagraph();
            paragraph.add(new Phrase(screeningLetter.getTrackingRecordScreening().getFacility().getCbsAddress()
                    .getCityStateZip().toUpperCase(), mediumfont));
            document.add(paragraph);
        }
    }

    // Add salutation
    paragraph = getParagraph();
    paragraph.add(new Phrase("Dear Director:", mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    // Add subject information
    paragraph = getParagraph();
    paragraph.add(new Phrase("RE: Notice of Agency Action", mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

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

    // Add FPI Details Line
    paragraph.clear();
    paragraph.add(new Phrase(screeningLetter.getDetails(), mediumfont));
    document.add(paragraph);

    // Start letter detail
    paragraph = getParagraph();
    paragraph.add(new Phrase(
            "In accordance with the Utah Administrative Procedures Act, Utah Code Ann. 63-46b-1 et. Seq, Utah Code Ann. 62A-2-101-116, ",
            mediumfont));
    paragraph.add(new Phrase(
            "Utah Code Ann. 62A-2-120 and Utah Department of Human Services rules, notice is hereby given of an Agency Action to deny the applicant's ",
            mediumfont));
    paragraph.add(new Phrase("background screening application.", mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    paragraph = getParagraph();
    paragraph.add(new Phrase(
            "The named individual failed to provide this office with required information to complete a background clearance by the Department ",
            mediumfont));
    paragraph.add(new Phrase(
            "of Human Services, and therefore is not permitted to have direct access to children or vulnerable adults, is not eligible to provide services ",
            mediumfont));
    paragraph.add(new Phrase(
            "to programs licensed by the Utah Department of Human Services, Office of Licensing, and is not eligible to proceed with foster care or ",
            mediumfont));
    paragraph.add(new Phrase("adoption until all procedures are completed.", mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    paragraph = getParagraph();
    paragraph.add(new Phrase("Please provide a copy of this letter to the applicant.", mediumfontB));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    paragraph = getParagraph();
    paragraph.add(new Phrase(
            "If the person is an applicant for adoption or foster care services, no further action can be taken in the licensing ",
            mediumfont));
    paragraph.add(new Phrase("process unless the denial is reversed after all appeals are final.", mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    paragraph = getParagraph();
    paragraph.add(new Phrase(
            "If the person is NOT an applicant for adoption or foster care services, you must immediately provide your Licensing Specialist ",
            mediumfont));
    paragraph.add(new Phrase(
            "with written notification as to how you intend to prevent the applicant from having any direct access to children or vulnerable adults.",
            mediumfont));
    paragraph.add(new Phrase(
            "The applicant is not authorized to have any direct access to children or vulnerable adults unless the denial is reversed after ",
            mediumfont));
    paragraph.add(new Phrase("all appeals are final.", mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    paragraph = getParagraph();
    paragraph.add(new Phrase(
            "Please direct any questions concerning this action to the Office of Licensing, Background Screening Unit, at ",
            mediumfont));
    paragraph.add(new Phrase("(801) 538-4242, or fax to me at (801) 538-4669.", mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

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

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

    paragraph = getParagraph();
    paragraph.add(new Phrase("Criminal Information Technician", mediumfont));
    document.add(paragraph);

    paragraph = getParagraph();
    paragraph.add(new Phrase("cc: Cathy Davis, DSPD", mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    paragraph = getParagraph();
    paragraph.add(new Phrase("File", mediumfont));
    paragraph.setIndentationLeft(18);
    document.add(paragraph);

    document.close();
}

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

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

    document.open();

    LetterheadStamper.stampLetter(writer, request);

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

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

    // Add facility name and address information
    paragraph = getParagraph();
    try {
        paragraph.add(new Phrase(screeningLetter.getTrackingRecordScreening().getFacility()
                .getLicensingSpecialist().getFirstAndLastName().toUpperCase(), mediumfont));
    } catch (Exception e) {
        paragraph.add(new Phrase("(Licensing Specialist Name)", mediumfontB));
    }
    document.add(paragraph);
    if (StringUtils.isNotBlank(screeningLetter.getAddress().getAddressOne())) {
        paragraph = getParagraph();
        paragraph.add(new Phrase(screeningLetter.getAddress().getAddressOne().toUpperCase(), mediumfont));
        document.add(paragraph);
    }
    if (StringUtils.isNotBlank(screeningLetter.getAddress().getAddressTwo())) {
        // Add facility location address two
        paragraph = getParagraph();
        paragraph.add(new Phrase(screeningLetter.getAddress().getAddressTwo().toUpperCase(), mediumfont));
        document.add(paragraph);
    }
    if (StringUtils.isNotBlank(screeningLetter.getAddress().getCityStateZip())) {
        paragraph = getParagraph();
        paragraph.add(new Phrase(screeningLetter.getAddress().getCityStateZip().toUpperCase(), mediumfont));
        document.add(paragraph);
    }

    // Add salutation
    paragraph = getParagraph();
    paragraph.add(new Phrase("Dear Licensor:", mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    // Add subject information
    paragraph = getParagraph();
    paragraph.add(new Phrase("RE: Notice of Agency Action", mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

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

    // Add FPI Details Line
    paragraph.clear();
    paragraph.add(new Phrase(screeningLetter.getDetails(), mediumfont));
    document.add(paragraph);

    // Start letter detail
    paragraph = getParagraph();
    paragraph.add(new Phrase("In accordance with the Utah Administrative Procedures Act, Utah Code Ann. ",
            mediumfont));
    paragraph.add(new Chunk("\u00A7", mediumfont));
    paragraph.add(new Phrase(" 63-46b-1 et. Seq, Utah Code Ann. ", mediumfont));
    paragraph.add(new Chunk("\u00A7", mediumfont));
    paragraph.add(new Phrase(" 62A-2-101-116, ", mediumfont));
    paragraph.add(new Phrase("Utah Code Ann. ", mediumfont));
    paragraph.add(new Chunk("\u00A7", mediumfont));
    paragraph.add(new Phrase(
            " 62A-2-120 and Utah Department of Human Services rules, notice is hereby given of an Agency Action to deny the applicant's ",
            mediumfont));
    paragraph.add(new Phrase("background screening application.", mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    paragraph = getParagraph();
    paragraph.add(new Phrase(
            "The named individual failed to provide this office with required information to complete a background clearance by the Department ",
            mediumfont));
    paragraph.add(new Phrase(
            "of Human Services, and therefore is not eligible to provide services to children, or programs licensed to DHS OL.",
            mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    paragraph = getParagraph();
    paragraph.add(new Phrase("Please provide a copy of this letter to the applicant.", mediumfontB));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    paragraph = getParagraph();
    paragraph.add(new Phrase(
            "If the person is an applicant for adoption or foster care services, no further action can be taken in the licensing ",
            mediumfont));
    paragraph.add(new Phrase("process unless the denial is reversed after all appeals are final.", mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    paragraph = getParagraph();
    paragraph.add(new Phrase(
            "Please direct any questions concerning this action to the Office of Licensing, Background Screening Unit, at ",
            mediumfont));
    paragraph.add(new Phrase("(801) 538-4242, or fax to me at (801) 538-4669. Thank you.", mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

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

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

    paragraph = getParagraph();
    paragraph.add(new Phrase("Criminal Information Technician", mediumfont));
    document.add(paragraph);

    document.close();
}

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

private static void writePdf(TrackingRecordScreeningLetter screeningLetter, OutputStream ba,
        HttpServletRequest request) throws DocumentException, BadElementException, IOException {
    Document document = null;// ww  w  . j  av a2s  .  c o  m
    Paragraph paragraph = null;
    document = new Document(PageSize.LETTER, 50, 50, 125, 0);
    PdfWriter writer = PdfWriter.getInstance(document, ba);
    SimpleDateFormat df = new SimpleDateFormat("MMMM d, yyyy");

    document.open();

    LetterheadStamper.stampLetter(writer, request);

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

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

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

    // Add salutation
    paragraph = getParagraph();
    paragraph.add(new Phrase("Dear Director:", mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    // Add subject information
    paragraph = getParagraph();
    paragraph.add(new Phrase("RE: Notice of Agency Action", mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

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

    // Add FPI Details Line
    paragraph.clear();
    paragraph.add(new Phrase(screeningLetter.getDetails(), mediumfont));
    document.add(paragraph);

    // Start letter detail
    paragraph = getParagraph();
    paragraph.add(new Phrase(
            "In accordance with the Utah Administrative Procedures Act, Utah Code Ann. 63-46b-1 et. Seq, Utah Code Ann. 62A-2-101-116, ",
            mediumfont));
    paragraph.add(new Phrase(
            "Utah Code Ann. 62A-2-120 and Utah Department of Human Services rules, notice is hereby given of an Agency Action to deny the applicant's ",
            mediumfont));
    paragraph.add(new Phrase("background screening application.", mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    paragraph = getParagraph();
    paragraph.add(new Phrase(
            "The named individual failed to provide this office with required information to complete a background clearance by the Department ",
            mediumfont));
    paragraph.add(new Phrase(
            "of Human Services, and therefore is not permitted to have direct access to children or vulnerable adults, is not eligible to provide services ",
            mediumfont));
    paragraph.add(new Phrase(
            "to programs licensed by the Utah Department of Human Services, Office of Licensing, and is not eligible to proceed with foster care or ",
            mediumfont));
    paragraph.add(new Phrase("adoption until all procedures are completed.", mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    paragraph = getParagraph();
    paragraph.add(new Phrase("Please provide a copy of this letter to the applicant.", mediumfontB));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    paragraph = getParagraph();
    paragraph.add(new Phrase(
            "If the person is an applicant for adoption or foster care services, no further action can be taken in the licensing ",
            mediumfont));
    paragraph.add(new Phrase("process unless the denial is reversed after all appeals are final.", mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    paragraph = getParagraph();
    paragraph.add(new Phrase(
            "If the person is NOT an applicant for adoption or foster care services, you must immediately provide your Licensing Specialist ",
            mediumfontB));
    paragraph.add(new Phrase(
            "with written notification as to how you intend to prevent the applicant from having any direct access to children or vulnerable adults.",
            mediumfontB));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    paragraph = getParagraph();
    paragraph.add(new Phrase(
            "The applicant is not authorized to have any direct access to children or vulnerable adults unless the denial is reversed after ",
            mediumfont));
    paragraph.add(new Phrase("all appeals are final.", mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    paragraph = getParagraph();
    paragraph.add(new Phrase(
            "Please direct any questions concerning this action to the Office of Licensing, Background Screening Unit, at ",
            mediumfont));
    paragraph.add(new Phrase("(801) 538-4242, or fax to me at (801) 538-4669.", mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

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

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

    paragraph = getParagraph();
    paragraph.add(new Phrase("Criminal Information Technician", mediumfont));
    document.add(paragraph);

    if (screeningLetter.getTrackingRecordScreening() != null
            && screeningLetter.getTrackingRecordScreening().getFacility() != null
            && screeningLetter.getTrackingRecordScreening().getFacility().getLicensingSpecialist() != null
            && StringUtils.isNotBlank(screeningLetter.getTrackingRecordScreening().getFacility()
                    .getLicensingSpecialist().getFirstAndLastName())) {
        paragraph = getParagraph();
        paragraph.add(new Phrase("CC: " + screeningLetter.getTrackingRecordScreening().getFacility()
                .getLicensingSpecialist().getFirstAndLastName(), mediumfont));
        paragraph.setSpacingBefore(10);
        document.add(paragraph);
    }

    document.close();
}

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

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

    document.open();

    LetterheadStamper.stampLetter(writer, request);

    LetterheadStamper.stampLetter(writer, request);

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

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

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

    // Add subject information
    paragraph = new Paragraph("RE: Notice of Criminal History Verification:", mediumfont);
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

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

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

    // Start letter detail
    paragraph = getParagraph();
    paragraph.add(new Phrase(
            "As a follow-up to the request for background screening by the Department of Human Services, Office of Licensing, ",
            mediumfont));
    paragraph.add(new Phrase(
            "this is to notify you that additional criminal background screening information is needed.  Initial procedures ",
            mediumfont));
    paragraph.add(new Phrase(
            "indicate the possibility of a criminal record.  Therefore, further review is required (UCA 62A-2-120, and R501-14).",
            mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    paragraph = getParagraph();
    paragraph.add(new Phrase(
            "You submitted fingerprint cards previously. We have one fingerprint card in your file that we can ",
            mediumfont));
    paragraph.add(new Phrase(
            "use for the verification. To proceed with the verification, we request a $20 fee in the form of a ",
            mediumfont));
    paragraph.add(new Phrase("cashier's check, or money order ", mediumfontI));
    paragraph.add(new Phrase("(no personal checks) payable to the ", mediumfont));
    paragraph.add(new Phrase("Department of Human Services. ", mediumfontI));
    paragraph.add(new Phrase(
            "Submit the fee to the Office of Licensing within 5 working days of your receipt of this notice. Please be sure ",
            mediumfont));
    paragraph.add(
            new Phrase("the payment references your name and last four digits of your social security number.",
                    mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

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

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

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

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

    paragraph = getParagraph();
    paragraph.add(new Phrase("Criminal Information Technician", mediumfont));
    document.add(paragraph);

    if (screeningLetter.getTrackingRecordScreening() != null
            && screeningLetter.getTrackingRecordScreening().getFacility() != null
            && screeningLetter.getTrackingRecordScreening().getFacility().getLicensingSpecialist() != null
            && StringUtils.isNotBlank(screeningLetter.getTrackingRecordScreening().getFacility()
                    .getLicensingSpecialist().getIntials())) {
        paragraph = getParagraph();
        paragraph.add(new Phrase("CC: " + screeningLetter.getTrackingRecordScreening().getFacility()
                .getLicensingSpecialist().getIntials(), mediumfont));
        paragraph.setSpacingBefore(10);
        document.add(paragraph);
    }

    document.close();
}

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

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

    document.open();

    LetterheadStamper.stampLetter(writer, request);

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

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

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

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

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

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

    // Start letter detail
    paragraph = getParagraph();
    paragraph.add(new Phrase(
            "As a follow-up to the request for background screening by the Department of Human Services, Office of Licensing, ",
            mediumfont));
    paragraph.add(new Phrase(
            "this is to notify you that additional criminal background screening information is needed.  Initial procedures ",
            mediumfont));
    paragraph.add(new Phrase(
            "indicate the possibility of a criminal record.  Therefore, further review is required (UCA 62A-2-120, and R501-14).",
            mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    paragraph = getParagraph();
    paragraph.add(new Phrase(
            "The applicant submitted fingerprint cards previously. We have one fingerprint card on file that we can ",
            mediumfont));
    paragraph.add(new Phrase(
            "use for the verification. To proceed with the verification, we request a $20 fee in the form of a ",
            mediumfont));
    paragraph.add(new Phrase("cashier's check, money order, or program business check ", mediumfontI));
    paragraph.add(new Phrase("(no personal checks) payable to the ", mediumfont));
    paragraph.add(new Phrase("Department of Human Services. ", mediumfontI));
    paragraph.add(new Phrase(
            "Submit the fee to the Office of Licensing within 5 working days of your receipt of this notice. Please be sure ",
            mediumfont));
    paragraph.add(new Phrase(
            "the payment references the applicant's name and last four digits of the applicant's social security number.",
            mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

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

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

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

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

    paragraph = getParagraph();
    paragraph.add(new Phrase("Criminal Information Technician", mediumfont));
    document.add(paragraph);

    document.close();
}

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

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

    document.open();

    LetterheadStamper.stampLetter(writer, request);

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

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

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

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

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

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

    // Start letter detail
    paragraph = getParagraph();
    paragraph.add(new Phrase(
            "As a follow-up to the request for background screening by the Department of Human Services, Office of Licensing, ",
            mediumfont));
    paragraph.add(new Phrase(
            "this is to notify you that additional criminal background screening information is needed.  Initial procedures ",
            mediumfont));
    paragraph.add(new Phrase(
            "indicate the possibility of a criminal record.  Therefore, further review is required (UCA 62A-2-120, and R501-14).",
            mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    paragraph = getParagraph();
    paragraph.add(new Phrase(
            "Enclosed is a fingerprint card for you to provide complete, accurate and legible identifying information. ",
            mediumfont));
    paragraph.add(
            new Phrase("Return the completed fingerprint card with a $20 fee in the form of a ", mediumfont));
    paragraph.add(new Phrase("cashier's check or money order ", mediumfontI));
    paragraph.add(new Phrase("(no personal checks) payable to the ", mediumfont));
    paragraph.add(new Phrase("Department of Human Services", mediumfontI));
    paragraph.add(new Phrase(
            ", to the Office of Licensing within 5 working days of your receipt of this notice.", mediumfont));
    paragraph.setSpacingBefore(10);
    paragraph.setSpacingAfter(10);
    document.add(paragraph);

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

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

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

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

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

    paragraph = getParagraph();
    paragraph.add(new Phrase("Criminal Information Technician", mediumfont));
    document.add(paragraph);

    if (screeningLetter.getTrackingRecordScreening() != null
            && screeningLetter.getTrackingRecordScreening().getFacility() != null
            && screeningLetter.getTrackingRecordScreening().getFacility().getLicensingSpecialist() != null
            && StringUtils.isNotBlank(screeningLetter.getTrackingRecordScreening().getFacility()
                    .getLicensingSpecialist().getIntials())) {
        paragraph = getParagraph();
        paragraph.add(new Phrase("CC: " + screeningLetter.getTrackingRecordScreening().getFacility()
                .getLicensingSpecialist().getIntials(), mediumfont));
        paragraph.setSpacingBefore(10);
        document.add(paragraph);
    }

    document.close();
}

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

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

    document.open();

    LetterheadStamper.stampLetter(writer, request);

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

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

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

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

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

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

    // Start letter detail
    paragraph = getParagraph();
    paragraph.add(new Phrase(
            "As a follow-up to the request for background screening by the Department of Human Services, Office of Licensing, ",
            mediumfont));
    paragraph.add(new Phrase(
            "this is to notify you that additional criminal background screening information is needed.  Initial procedures ",
            mediumfont));
    paragraph.add(new Phrase(
            "indicate the possibility of a criminal record.  Therefore, further review is required (UCA 62A-2-120, and R501-14).",
            mediumfont));
    paragraph.setSpacingBefore(10);
    document.add(paragraph);

    paragraph = getParagraph();
    paragraph.add(new Phrase(
            "Enclosed is a fingerprint card for the applicant to provide complete, accurate and legible identifying information. ",
            mediumfont));
    paragraph.add(
            new Phrase("Return the completed fingerprint card with a $20 fee in the form of a ", mediumfont));
    paragraph.add(new Phrase("cashier's check or money order ", mediumfontI));
    paragraph.add(new Phrase("(no personal checks) payable to the ", mediumfont));
    paragraph.add(new Phrase("Department of Human Services", mediumfontI));
    paragraph.add(new Phrase(
            ", to the Office of Licensing within 5 working days of your receipt of this notice.", mediumfont));
    paragraph.setSpacingBefore(10);
    paragraph.setSpacingAfter(10);
    document.add(paragraph);

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

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

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

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

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

    paragraph = new Paragraph("Criminal Information Technician", mediumfont);
    document.add(paragraph);

    document.close();
}

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

public static ByteArrayOutputStream generate(TrackingRecordScreeningLetter screeningLetter) {
    ByteArrayOutputStream ba = null;
    Document document = null;//from w  ww.j  av a2 s  .  c o  m
    try {
        ba = new ByteArrayOutputStream();
        document = new Document(PageSize.LETTER, 35, 35, 75, 0);
        PdfWriter writer = PdfWriter.getInstance(document, ba);

        document.open();

        // LS Authorization Letter Page 1
        generateDocumentPage1(screeningLetter, document, writer);

        // Shift to page 2
        document.newPage();

        // LS Authorization Letter Page 2
        generateDocumentPage2(screeningLetter, document, writer);

        document.close();
    } catch (Exception ex) {
        log.error(ex.getMessage());
        ba = null;
    }
    return ba;
}

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

public static ByteArrayOutputStream generate(TrackingRecordScreeningLetter screeningLetter) {
    ByteArrayOutputStream ba = null;
    Document document = null;/*from w  w  w .  java  2  s  .  com*/
    try {
        ba = new ByteArrayOutputStream();
        document = new Document(PageSize.LETTER, 30, 30, 100, 25);
        PdfWriter writer = PdfWriter.getInstance(document, ba);

        document.open();

        // LS Authorization Letter Page 1
        generateDocumentPage1(screeningLetter, document, writer);

        // Shift to page 2
        document.newPage();

        // LS Authorization Letter Page 2
        generateDocumentPage2(screeningLetter, document, writer);

        document.close();
    } catch (Exception ex) {
        log.error(ex.getMessage());
        ba = null;
    }
    return ba;
}