Example usage for com.itextpdf.text Element ALIGN_TOP

List of usage examples for com.itextpdf.text Element ALIGN_TOP

Introduction

In this page you can find the example usage for com.itextpdf.text Element ALIGN_TOP.

Prototype

int ALIGN_TOP

To view the source code for com.itextpdf.text Element ALIGN_TOP.

Click Source Link

Document

A possible value for vertical alignment.

Usage

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

private static PdfPTable getPage1WriteInLine2() throws BadElementException, DocumentException, Exception {
    PdfPTable table = new PdfPTable(2);
    PdfPTable dtl = null;/*from   w  ww  .ja va2  s . c o m*/
    PdfPCell cell = null;

    int headerwidths[] = { 4, 96 }; // percentage
    table.setWidths(headerwidths); // percentage
    table.setWidthPercentage(100);
    table.setSpacingBefore(page1ListSpace);
    table.getDefaultCell().setPadding(0);
    table.getDefaultCell().setBorder(Rectangle.NO_BORDER);

    dtl = new PdfPTable(12);
    headerwidths = new int[] { 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 9 }; // percentage
    dtl.setWidths(headerwidths); // percentage
    dtl.setWidthPercentage(100);
    dtl.getDefaultCell().setLeading(fixedLeadingSmall, 0);
    dtl.getDefaultCell().setPadding(0);
    dtl.getDefaultCell().setBorder(Rectangle.NO_BORDER);
    dtl.getDefaultCell().setVerticalAlignment(Element.ALIGN_BOTTOM);
    dtl.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    cell = new PdfPCell(dtl.getDefaultCell());
    cell.setCellEvent(new FloatingLinedPdfPCell());
    cell.setPhrase(SMALL_BLANK);
    dtl.addCell(cell);
    cell = new PdfPCell(dtl.getDefaultCell());
    cell.setCellEvent(new FloatingPdfPCell());
    cell.setPhrase(SMALL_BLANK);
    dtl.addCell(cell);
    cell = new PdfPCell(dtl.getDefaultCell());
    cell.setCellEvent(new FloatingLinedPdfPCell());
    cell.setPhrase(SMALL_BLANK);
    dtl.addCell(cell);
    cell = new PdfPCell(dtl.getDefaultCell());
    cell.setCellEvent(new FloatingPdfPCell());
    cell.setPhrase(SMALL_BLANK);
    dtl.addCell(cell);
    cell = new PdfPCell(dtl.getDefaultCell());
    cell.setCellEvent(new FloatingLinedPdfPCell());
    cell.setPhrase(SMALL_BLANK);
    dtl.addCell(cell);
    cell = new PdfPCell(dtl.getDefaultCell());
    cell.setCellEvent(new FloatingPdfPCell());
    cell.setPhrase(SMALL_BLANK);
    dtl.addCell(cell);
    cell = new PdfPCell(dtl.getDefaultCell());
    cell.setCellEvent(new FloatingLinedPdfPCell());
    cell.setPhrase(SMALL_BLANK);
    dtl.addCell(cell);
    cell = new PdfPCell(dtl.getDefaultCell());
    cell.setCellEvent(new FloatingPdfPCell());
    cell.setPhrase(SMALL_BLANK);
    dtl.addCell(cell);
    cell = new PdfPCell(dtl.getDefaultCell());
    cell.setCellEvent(new FloatingLinedPdfPCell());
    cell.setPhrase(SMALL_BLANK);
    dtl.addCell(cell);
    cell = new PdfPCell(dtl.getDefaultCell());
    cell.setCellEvent(new FloatingPdfPCell());
    cell.setPhrase(SMALL_BLANK);
    dtl.addCell(cell);
    cell = new PdfPCell(dtl.getDefaultCell());
    cell.setCellEvent(new FloatingLinedPdfPCell());
    cell.setPhrase(SMALL_BLANK);
    dtl.addCell(cell);
    cell = new PdfPCell(dtl.getDefaultCell());
    cell.setCellEvent(new FloatingPdfPCell());
    cell.setPhrase(SMALL_BLANK);
    dtl.addCell(cell);
    table.addCell(SMALL_BLANK); // Leave first cell blank
    table.addCell(dtl);

    dtl = new PdfPTable(12);
    headerwidths = new int[] { 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 9 }; // percentage
    dtl.setWidths(headerwidths); // percentage
    dtl.setWidthPercentage(100);
    dtl.getDefaultCell().setLeading(fixedLeadingSmall, 0);
    dtl.getDefaultCell().setPadding(0);
    dtl.getDefaultCell().setBorder(Rectangle.NO_BORDER);
    dtl.getDefaultCell().setVerticalAlignment(Element.ALIGN_TOP);
    dtl.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    dtl.getDefaultCell().setCellEvent(new FloatingPdfPCell());
    dtl.addCell(new Phrase("DOB", smallfont));
    dtl.addCell(SMALL_BLANK);
    dtl.addCell(new Phrase("Eye Color", smallfont));
    dtl.addCell(SMALL_BLANK);
    dtl.addCell(new Phrase("Hair Color", smallfont));
    dtl.addCell(SMALL_BLANK);
    dtl.addCell(new Phrase("Weight", smallfont));
    dtl.addCell(SMALL_BLANK);
    dtl.addCell(new Phrase("Height", smallfont));
    dtl.addCell(SMALL_BLANK);
    dtl.addCell(new Phrase("Gender", smallfont));
    dtl.addCell(SMALL_BLANK);
    table.addCell(SMALL_BLANK); // Leave first cell blank
    table.addCell(dtl);

    return table;
}

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

private static PdfPTable getPage1WriteInLine3() throws BadElementException, DocumentException, Exception {
    PdfPTable table = new PdfPTable(2);
    PdfPTable dtl = null;/*from   w w  w .  ja  v  a  2  s . co m*/
    PdfPCell cell = null;

    int headerwidths[] = { 4, 96 }; // percentage
    table.setWidths(headerwidths); // percentage
    table.setWidthPercentage(100);
    table.setSpacingBefore(page1ListSpace);
    table.getDefaultCell().setPadding(0);
    table.getDefaultCell().setBorder(Rectangle.NO_BORDER);

    dtl = new PdfPTable(7);
    headerwidths = new int[] { 24, 5, 21, 5, 16, 5, 24 }; // percentage
    dtl.setWidths(headerwidths); // percentage
    dtl.setWidthPercentage(100);
    dtl.getDefaultCell().setLeading(fixedLeadingSmall, 0);
    dtl.getDefaultCell().setPadding(0);
    dtl.getDefaultCell().setBorder(Rectangle.NO_BORDER);
    dtl.getDefaultCell().setVerticalAlignment(Element.ALIGN_BOTTOM);
    dtl.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    cell = new PdfPCell(dtl.getDefaultCell());
    cell.setCellEvent(new FloatingLinedPdfPCell());
    cell.setPhrase(SMALL_BLANK);
    dtl.addCell(cell);
    cell = new PdfPCell(dtl.getDefaultCell());
    cell.setCellEvent(new FloatingPdfPCell());
    cell.setPhrase(SMALL_BLANK);
    dtl.addCell(cell);
    cell = new PdfPCell(dtl.getDefaultCell());
    cell.setCellEvent(new FloatingLinedPdfPCell());
    cell.setPhrase(SMALL_BLANK);
    dtl.addCell(cell);
    cell = new PdfPCell(dtl.getDefaultCell());
    cell.setCellEvent(new FloatingPdfPCell());
    cell.setPhrase(SMALL_BLANK);
    dtl.addCell(cell);
    cell = new PdfPCell(dtl.getDefaultCell());
    cell.setCellEvent(new FloatingLinedPdfPCell());
    cell.setPhrase(SMALL_BLANK);
    dtl.addCell(cell);
    cell = new PdfPCell(dtl.getDefaultCell());
    cell.setCellEvent(new FloatingPdfPCell());
    cell.setPhrase(SMALL_BLANK);
    dtl.addCell(cell);
    cell = new PdfPCell(dtl.getDefaultCell());
    cell.setCellEvent(new FloatingLinedPdfPCell());
    cell.setPhrase(SMALL_BLANK);
    dtl.addCell(cell);
    table.addCell(SMALL_BLANK); // Leave first cell blank
    table.addCell(dtl);

    dtl = new PdfPTable(7);
    headerwidths = new int[] { 24, 5, 21, 5, 16, 5, 24 }; // percentage
    dtl.setWidths(headerwidths); // percentage
    dtl.setWidthPercentage(100);
    dtl.getDefaultCell().setLeading(fixedLeadingSmall, 0);
    dtl.getDefaultCell().setPadding(0);
    dtl.getDefaultCell().setBorder(Rectangle.NO_BORDER);
    dtl.getDefaultCell().setVerticalAlignment(Element.ALIGN_TOP);
    dtl.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    dtl.getDefaultCell().setCellEvent(new FloatingPdfPCell());
    dtl.addCell(new Phrase("Social Security Number", smallfont));
    dtl.addCell(SMALL_BLANK);
    dtl.addCell(new Phrase("Place of Birth", smallfont));
    dtl.addCell(SMALL_BLANK);
    dtl.addCell(new Phrase("Race", smallfont));
    dtl.addCell(SMALL_BLANK);
    dtl.addCell(new Phrase("Country of Citizenship", smallfont));
    table.addCell(SMALL_BLANK); // Leave first cell blank
    table.addCell(dtl);

    return table;
}

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 ww .  j a v a 2s  . c o m*/
    int headerwidths[] = {};
    Paragraph paragraph = null;
    List blist = null;
    ListItem item = null;
    ListItem subItem = null;
    SimpleDateFormat df = new SimpleDateFormat("MM/dd/yyyy");
    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.LivescanAuthorizationB1606.java

private static void generateDocumentPage1(TrackingRecordScreeningLetter screeningLetter, Document document,
        PdfWriter writer) throws BadElementException, DocumentException, Exception {
    PdfPTable table = null;/*  w ww. j a v  a2s.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:GUI_StafKlinik.Panel_Penggajian.java

private PdfPTable createTableLaporan(Penggajian p) {
    PdfPTable tabel = new PdfPTable(2);
    PdfPCell cell;//from w  ww. ja  v a2  s  .  co m

    cell = new PdfPCell(new Phrase(("Nama Pegawai"), font2));
    cell.setVerticalAlignment(Element.ALIGN_TOP);
    cell.setColspan(1);
    cell.setBorder(Rectangle.BOX);
    cell.setBorderWidth(1);
    cell.setBorderColor(BaseColor.WHITE);
    tabel.addCell(cell);

    cell = new PdfPCell(new Phrase(("" + p.getNamaPegawai()), font2));
    cell.setVerticalAlignment(Element.ALIGN_TOP);
    cell.setBorderWidth(1);
    cell.setBorderColor(BaseColor.WHITE);
    tabel.addCell(cell);

    cell = new PdfPCell(new Phrase(("ID Pegawai"), font2));
    cell.setVerticalAlignment(Element.ALIGN_TOP);
    cell.setColspan(1);
    cell.setBorder(Rectangle.BOX);
    cell.setBorderWidth(1);
    cell.setBorderColor(BaseColor.WHITE);
    tabel.addCell(cell);

    cell = new PdfPCell(new Phrase(("" + p.getIdPegawai()), font2));
    cell.setVerticalAlignment(Element.ALIGN_TOP);
    cell.setBorderWidth(1);
    cell.setBorderColor(BaseColor.WHITE);
    tabel.addCell(cell);

    cell = new PdfPCell(new Phrase(("Alamat"), font2));
    cell.setVerticalAlignment(Element.ALIGN_TOP);
    cell.setColspan(1);
    cell.setBorder(Rectangle.BOX);
    cell.setBorderWidth(1);
    cell.setBorderColor(BaseColor.WHITE);
    tabel.addCell(cell);

    cell = new PdfPCell(new Phrase((""), font2));
    cell.setVerticalAlignment(Element.ALIGN_TOP);
    cell.setBorderWidth(1);
    cell.setBorderColor(BaseColor.WHITE);
    tabel.addCell(cell);

    cell = new PdfPCell(new Phrase(("Telepon"), font2));
    cell.setVerticalAlignment(Element.ALIGN_TOP);
    cell.setColspan(1);
    cell.setBorder(Rectangle.BOX);
    cell.setBorderWidth(1);
    cell.setBorderColor(BaseColor.WHITE);
    tabel.addCell(cell);

    cell = new PdfPCell(new Phrase((""), font2));
    cell.setVerticalAlignment(Element.ALIGN_TOP);
    cell.setBorderWidth(1);
    cell.setBorderColor(BaseColor.WHITE);
    tabel.addCell(cell);

    cell = new PdfPCell(new Phrase(("Jabatan"), font2));
    cell.setVerticalAlignment(Element.ALIGN_TOP);
    cell.setColspan(1);
    cell.setBorder(Rectangle.BOX);
    cell.setBorderWidth(1);
    cell.setBorderColor(BaseColor.WHITE);
    tabel.addCell(cell);

    cell = new PdfPCell(new Phrase((""), font2));
    cell.setVerticalAlignment(Element.ALIGN_TOP);
    cell.setBorderWidth(1);
    cell.setBorderColor(BaseColor.WHITE);
    tabel.addCell(cell);

    cell = new PdfPCell(new Phrase(("Gaji Pokok"), font2));
    cell.setVerticalAlignment(Element.ALIGN_TOP);
    cell.setColspan(1);
    cell.setBorder(Rectangle.BOX);
    cell.setBorderWidth(1);
    cell.setBorderColor(BaseColor.WHITE);
    tabel.addCell(cell);

    cell = new PdfPCell(new Phrase(("" + p.getGajiPokok()), font2));
    cell.setVerticalAlignment(Element.ALIGN_TOP);
    cell.setBorderWidth(1);
    cell.setBorderColor(BaseColor.WHITE);
    tabel.addCell(cell);

    cell = new PdfPCell(new Phrase(("Gaji Tambahan"), font2));
    cell.setVerticalAlignment(Element.ALIGN_TOP);
    cell.setColspan(1);
    cell.setBorder(Rectangle.BOX);
    cell.setBorderWidth(1);
    cell.setBorderColor(BaseColor.WHITE);
    tabel.addCell(cell);

    cell = new PdfPCell(new Phrase(("" + p.getGajiTambahan()), font2));
    cell.setVerticalAlignment(Element.ALIGN_TOP);
    cell.setBorderWidth(1);
    cell.setBorderColor(BaseColor.WHITE);
    tabel.addCell(cell);

    cell = new PdfPCell(new Phrase(("Total Gaji"), font2));
    cell.setVerticalAlignment(Element.ALIGN_TOP);
    cell.setColspan(1);
    cell.setBorder(Rectangle.BOX);
    cell.setBorderWidth(1);
    cell.setBorderColor(BaseColor.WHITE);
    tabel.addCell(cell);

    cell = new PdfPCell(new Phrase(("" + p.getTotalGaji()), font2));
    cell.setVerticalAlignment(Element.ALIGN_TOP);
    cell.setBorderWidth(1);
    cell.setBorderColor(BaseColor.WHITE);
    tabel.addCell(cell);

    return tabel;
}

From source file:jdbreport.model.io.pdf.itext5.ITextWriter.java

License:Apache License

protected int toPdfVAlignment(int verticalAlignment) {
    switch (verticalAlignment) {
    case CellStyle.TOP:
        return Element.ALIGN_TOP;
    case CellStyle.BOTTOM:
        return Element.ALIGN_BOTTOM;
    case CellStyle.CENTER:
        return Element.ALIGN_CENTER;
    }/*from ww w  .  j ava 2  s  . c o m*/
    return Element.ALIGN_TOP;
}

From source file:org.bonitasoft.studio.migration.utils.PDFMigrationReportWriter.java

License:Open Source License

private void addTableRow(PdfPTable table, Change change)
        throws BadElementException, MalformedURLException, IOException {
    PdfPCell cell = new PdfPCell(new Phrase(change.getElementType()));
    cell.setHorizontalAlignment(Element.ALIGN_LEFT);
    cell.setVerticalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);/*from w  w w.ja  va2 s  .  co  m*/

    cell = new PdfPCell(new Phrase(change.getElementName()));
    cell.setHorizontalAlignment(Element.ALIGN_LEFT);
    cell.setVerticalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);

    cell = new PdfPCell(new Phrase(change.getPropertyName()));
    cell.setHorizontalAlignment(Element.ALIGN_LEFT);
    cell.setVerticalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);

    cell = new PdfPCell(new Phrase(change.getDescription()));
    cell.setHorizontalAlignment(Element.ALIGN_JUSTIFIED);
    cell.setVerticalAlignment(Element.ALIGN_TOP);
    cell.setPadding(4f);
    table.addCell(cell);

    cell = new PdfPCell(getImageForStatus(change.getStatus()), false);
    cell.setPadding(10f);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.setVerticalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);

    String reviewed = Messages.no;
    if (change.isReviewed()) {
        reviewed = Messages.yes;
    }
    cell = new PdfPCell(new Phrase(reviewed));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.setVerticalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
}

From source file:org.ganttproject.impex.htmlpdf.itext.ThemeImpl.java

License:GNU General Public License

private PdfPTable createColontitleTable(String topLeft, String topRight, String bottomLeft,
        String bottomRight) {/*from  w  ww. j a va  2 s  . c  o m*/
    PdfPTable head = new PdfPTable(2);
    {
        PdfPCell cell = new PdfPCell();
        cell.setBorder(Rectangle.NO_BORDER);
        Paragraph p = new Paragraph(topLeft, getSansRegularBold(18));
        p.setAlignment(Paragraph.ALIGN_LEFT);
        // colontitle.setLeading(0);
        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell.setVerticalAlignment(Element.ALIGN_BOTTOM);
        // cell.setPaddingLeft(2);
        cell.setPaddingBottom(6);
        cell.setPhrase(p);
        head.addCell(cell);
    }
    {
        PdfPCell cell = new PdfPCell();
        cell.setBorder(Rectangle.NO_BORDER);
        Paragraph p = new Paragraph(topRight, getSansRegularBold(10));
        p.setAlignment(Paragraph.ALIGN_RIGHT);
        cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
        cell.setVerticalAlignment(Element.ALIGN_BOTTOM);
        cell.setPaddingBottom(6);
        cell.setPhrase(p);
        head.addCell(cell);
    }
    {
        PdfPCell cell = new PdfPCell();
        cell.setVerticalAlignment(Element.ALIGN_TOP);
        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell.setPaddingLeft(3);
        cell.setPaddingTop(2);
        cell.setPaddingBottom(6);
        cell.setBorder(Rectangle.TOP);
        cell.setBorderWidthTop(2);
        cell.setBorderColor(SORTAVALA_GREEN);
        Paragraph p = new Paragraph(bottomLeft, getSansRegularBold(18));
        p.setAlignment(Paragraph.ALIGN_LEFT);
        p.setExtraParagraphSpace(0);
        p.setIndentationLeft(0);
        p.setSpacingBefore(0);
        cell.setPhrase(p);
        // cell.addElement(p);
        head.addCell(cell);
    }
    {
        PdfPCell cell = new PdfPCell();
        cell.setVerticalAlignment(Element.ALIGN_TOP);
        cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
        cell.setPaddingTop(2);
        cell.setPaddingBottom(6);
        cell.setBorder(Rectangle.TOP);
        cell.setBorderWidthTop(2);
        cell.setBorderColor(SORTAVALA_GREEN);
        Paragraph p = new Paragraph(bottomRight, getSansRegularBold(10));
        p.setAlignment(Paragraph.ALIGN_RIGHT);
        cell.setPhrase(p);
        head.addCell(cell);
    }
    final Document document = myDoc;
    Rectangle page = document.getPageSize();
    head.setTotalWidth(page.getWidth() - document.leftMargin() - document.rightMargin());
    return head;
}

From source file:pdf.PDFDesign.java

private PdfPCell createEuroInnerInnerPrice(String price, String curr, boolean isFirst)
        throws DocumentException {

    Font bigPriceFont = new Font(droidsans, 40, Font.BOLD, color);
    Font smallPriceFont = new Font(droidsans, 18, Font.NORMAL, color);
    Font unitFont = new Font(droidsans, 12, Font.NORMAL, color);

    PdfPTable table = new PdfPTable(2);
    table.setWidths(new float[] { 3f, 1f });
    PdfPCell cell;//from ww  w  . j  a  v  a  2  s . c o m
    Paragraph para;

    para = new Paragraph("");
    para.setFont(bigPriceFont);
    if (price.length() >= 4) {
        para.add(price.substring(0, price.length() - 3));
    }
    cell = new PdfPCell(para);
    cell.setRowspan(2);
    cell.setFixedHeight(57f);
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
    cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
    cell.setBorder(0);
    table.addCell(cell);

    para = new Paragraph("");
    para.setFont(smallPriceFont);
    if (price.length() >= 4) {
        para.add(price.substring(price.length() - 2, price.length()));
    }
    cell = new PdfPCell(para);
    cell.setRowspan(1);
    cell.setFixedHeight(35f);
    cell.setVerticalAlignment(Element.ALIGN_BOTTOM);
    cell.setBorder(0);
    table.addCell(cell);

    para = new Paragraph();
    para.setFont(unitFont);
    para.add(curr);
    cell = new PdfPCell(para);
    cell.setRowspan(1);
    cell.setFixedHeight(22f);
    cell.setVerticalAlignment(Element.ALIGN_TOP);
    cell.setBorder(0);
    table.addCell(cell);

    PdfPCell finalCell = new PdfPCell(table);
    finalCell.setBorder(0);
    /*if (isFirst) {
     finalCell.setBorder(Rectangle.RIGHT);
     }*/
    return finalCell;
}

From source file:pdf.PDFDesign.java

private PdfPCell createEuro_6_InnerInnerPrice(String price, String curr, boolean isFirst)
        throws DocumentException {
    PdfPTable table = new PdfPTable(2);
    table.setWidths(new float[] { 3f, 1.2f });
    PdfPCell cell;/*from w w  w .ja  v  a  2s.  com*/
    Paragraph para;

    para = new Paragraph("");
    para.setFont(new Font(droidsans, 60, Font.BOLD, color));
    if (price.length() >= 4) {
        para.add(price.substring(0, price.length() - 3));
    }
    cell = new PdfPCell(para);
    cell.setRowspan(2);
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
    cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
    cell.setLeading(50f, 0f);
    cell.setBorder(0);
    table.addCell(cell);

    para = new Paragraph("");
    para.setFont(new Font(droidsans, 28, Font.NORMAL, color));
    if (price.length() >= 4) {
        para.add(price.substring(price.length() - 2, price.length()));
    }
    cell = new PdfPCell(para);
    cell.setRowspan(1);
    cell.setFixedHeight(32f);
    cell.setVerticalAlignment(Element.ALIGN_BOTTOM);
    cell.setBorder(0);
    table.addCell(cell);

    para = new Paragraph();
    para.setFont(new Font(droidsans, 16, Font.NORMAL, color));
    para.add(curr);
    cell = new PdfPCell(para);
    cell.setRowspan(1);
    cell.setVerticalAlignment(Element.ALIGN_TOP);
    cell.setBorder(0);
    table.addCell(cell);

    PdfPCell finalCell = new PdfPCell(table);
    finalCell.setBorder(0);
    /*if (isFirst) {
    finalCell.setBorder(Rectangle.RIGHT);
    }*/
    return finalCell;
}