Example usage for com.itextpdf.text BaseColor ORANGE

List of usage examples for com.itextpdf.text BaseColor ORANGE

Introduction

In this page you can find the example usage for com.itextpdf.text BaseColor ORANGE.

Prototype

BaseColor ORANGE

To view the source code for com.itextpdf.text BaseColor ORANGE.

Click Source Link

Usage

From source file:be.kcbj.placemat.Placemat.java

License:Open Source License

private PdfPCell generateCell(Sponsor sponsor, float cellHeight) throws IOException, BadElementException {
    int numLines = 0;
    Paragraph p = new Paragraph();

    if (sponsor.image != null) {
        Image image = Image.getInstance(SponsorManager.getImageUrl(sponsor.image));
        if (sponsor.imageWidth != 0) {
            image.scaleToFit(sponsor.imageWidth, 1000);
        } else if (sponsor.imageHeight != 0) {
            image.scaleToFit(1000, sponsor.imageHeight);
        }// w  ww. ja v a2s.c o m
        Chunk imageChunk = new Chunk(image, 0, 0, true);
        p.add(imageChunk);
    }

    if (sponsor.twoColumns) {
        StringBuilder sb = new StringBuilder();
        if (sponsor.name != null) {
            sb.append(sponsor.name);
        }
        if (sponsor.name2 != null) {
            if (sb.length() > 0) {
                sb.append(" - ");
            }
            sb.append(sponsor.name2);
        }
        if (sponsor.address != null) {
            if (sb.length() > 0) {
                sb.append(" - ");
            }
            sb.append(sponsor.address);
        }
        if (sponsor.address2 != null) {
            if (sb.length() > 0) {
                sb.append(" - ");
            }
            sb.append(sponsor.address2);
        }
        p.add(Chunk.NEWLINE);
        p.add(new Chunk(sb.toString(), new Font(Font.FontFamily.HELVETICA, 8, Font.NORMAL)));
        numLines++;
    } else {
        if (sponsor.twoRows && sponsor.image != null) {
            p.add(Chunk.NEWLINE);
        }
        if (sponsor.name != null) {
            p.add(generateFittedChunk(sponsor.name, Font.BOLD));
            numLines++;
        }
        if (sponsor.name2 != null) {
            p.add(Chunk.NEWLINE);
            p.add(generateFittedChunk(sponsor.name2, Font.BOLD));
            numLines++;
        }
        if (sponsor.address != null) {
            p.add(new Chunk("\n\n", new Font(Font.FontFamily.HELVETICA, 2, Font.NORMAL)));
            p.add(new Chunk(sponsor.address, new Font(Font.FontFamily.HELVETICA, 7, Font.NORMAL)));
            numLines++;
        }
        if (sponsor.address2 != null) {
            p.add(Chunk.NEWLINE);
            p.add(new Chunk(sponsor.address2, new Font(Font.FontFamily.HELVETICA, 7, Font.NORMAL)));
            numLines++;
        }
    }
    p.setPaddingTop(0);
    p.setSpacingBefore(0);
    p.setAlignment(Element.ALIGN_CENTER);
    p.setMultipliedLeading(numLines <= 3 ? 1.3f : 1.1f);

    PdfPCell cell = new PdfPCell();
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
    cell.setFixedHeight(cellHeight);
    if (sponsor.twoColumns) {
        cell.setColspan(2);
    }
    if (sponsor.twoRows) {
        cell.setRowspan(2);
        if (sponsor.image == null) {
            p.setMultipliedLeading(p.getMultipliedLeading() * 1.5f);
        }
    }
    cell.setBorder(PdfPCell.NO_BORDER);
    cell.setCellEvent(CELL_EVENT);
    cell.setPaddingBottom(4);
    cell.addElement(p);
    if (sponsor.isTodo()) {
        cell.setBackgroundColor(BaseColor.ORANGE);
    }

    return cell;
}

From source file:br.com.ifrn.panfleto.gui.PainelCadastrar.java

public BaseColor corPagina() {
    if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Branco")) {
        return BaseColor.WHITE;
    } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Preto")) {
        return BaseColor.BLACK;
    } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Azul")) {
        return BaseColor.BLUE;
    } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Cinza Escuro")) {
        return BaseColor.DARK_GRAY;
    } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Cinza")) {
        return BaseColor.GRAY;
    } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Cinza Claro")) {
        return BaseColor.LIGHT_GRAY;
    } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Magenta")) {
        return BaseColor.MAGENTA;
    } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Laranja")) {
        return BaseColor.ORANGE;
    } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Rosa")) {
        return BaseColor.PINK;
    } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Vermlho")) {
        return BaseColor.RED;
    } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Amarero")) {
        return BaseColor.YELLOW;
    } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Cyan")) {
        return BaseColor.CYAN;
    }/*  w w w  .  ja  va  2s  . c  o m*/

    return BaseColor.WHITE;
}

From source file:com.mss.msp.util.DataSourceDataProvider.java

License:Open Source License

public PdfPTable getITextPDFTable(String gridData, PdfPTable table) throws ServiceLocatorException {

    if (!"".equals(gridData)) {

        // int Count = stk.countTokens();
        //  System.out.println("Total Count-->" + Count);
        String[] s = gridData.split("\\^");
        for (int i = 0; i < s.length; i++) {
            System.out.println("stk.split;-->" + s[i]);
            String ss = s[i];//w w  w  .  j a  va 2 s.c  o m
            String[] inner = ss.split("\\|");
            //  System.out.println("inner--->"+inner);
            for (int j = 0; j < inner.length; j++) {
                System.out.println("inner.split;-->" + inner[j]);
                if (i == 0) {
                    PdfPCell cell = new PdfPCell(new Paragraph(inner[j]));
                    cell.setBackgroundColor(BaseColor.ORANGE);
                    table.addCell(cell);
                } else {
                    table.addCell(inner[j]);
                }
            }
        }
    }

    return table;

}

From source file:com.systemevent.jsfclass.util.PdfEvento.java

public PdfPTable Tabla_compleja() {
    //creamos una tabla con 3 columnas
    PdfPTable mitablacompleja = new PdfPTable(3);
    //aadimos texto con formato a la primera celda
    PdfPCell celda = new PdfPCell(new Paragraph("Historial de Observaciones", FontFactory.getFont("arial", // fuente
            22, // tamao
            Font.BOLD, // estilo
            BaseColor.RED))); // color
    //unimos esta celda con otras 2
    celda.setColspan(3);/* w w w  .  j  a  v  a 2 s .c  o m*/
    //alineamos el contenido al centro
    celda.setHorizontalAlignment(Element.ALIGN_CENTER);
    // aadimos un espaciado
    celda.setPadding(12.0f);
    //colocamos un color de fondo
    celda.setBackgroundColor(BaseColor.GRAY);
    //se aade a la tabla
    mitablacompleja.addCell(celda);

    //fila 2
    celda = new PdfPCell(new Paragraph("AUDITORIA DE SISTEMAS"));
    celda.setColspan(2);
    celda.setBackgroundColor(BaseColor.GREEN);
    mitablacompleja.addCell(celda);
    celda = new PdfPCell(new Paragraph("Aprobado"));
    celda.setBackgroundColor(BaseColor.LIGHT_GRAY);
    mitablacompleja.addCell(celda);
    //fila 3        
    celda = new PdfPCell(new Paragraph("COMPILADORES"));
    celda.setColspan(2);
    celda.setBackgroundColor(BaseColor.YELLOW);
    mitablacompleja.addCell(celda);
    celda = new PdfPCell(new Paragraph("Reprobado"));
    celda.setBackgroundColor(BaseColor.LIGHT_GRAY);
    mitablacompleja.addCell(celda);
    //fila 4        
    celda = new PdfPCell(new Paragraph("Prog. Bajo Nivel"));
    celda.setColspan(2);
    celda.setBackgroundColor(BaseColor.CYAN);
    mitablacompleja.addCell(celda);
    celda = new PdfPCell(new Paragraph("Eximido"));
    celda.setBackgroundColor(BaseColor.LIGHT_GRAY);
    mitablacompleja.addCell(celda);
    //fila 5
    mitablacompleja.addCell("Conclusion");
    celda = new PdfPCell(new Paragraph("GET A LIFE!!!"));
    celda.setHorizontalAlignment(Element.ALIGN_RIGHT);
    celda.setColspan(2);
    celda.setBackgroundColor(BaseColor.ORANGE);
    mitablacompleja.addCell(celda);
    // se retorna la tabla

    return mitablacompleja;
}

From source file:frames.main.java

private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
    try {//  w w w.j a va 2 s.  c om

        BaseFont unicode = BaseFont.createFont("c:/windows/fonts/ALGER.ttf", BaseFont.IDENTITY_H,
                BaseFont.EMBEDDED);
        Font font1003 = new Font(unicode, 18, Font.ITALIC, new BaseColor(139, 0, 0));
        Font font1008 = new Font(unicode, 20, Font.BOLD, new BaseColor(101, 67, 33));
        Font font1004 = new Font(unicode, 18, Font.BOLD, new BaseColor(139, 0, 0));
        Font font1009 = new Font(unicode, 10, Font.NORMAL, new BaseColor(139, 10, 20));
        Font font1005 = new Font(unicode, 18, Font.UNDERLINE, new BaseColor(101, 67, 33));
        Font font1006 = new Font(unicode, 9, Font.BOLDITALIC, new BaseColor(101, 67, 33));
        // Rectangle rect=new RectangleReadOnly(590, 470, 0);
        /////////////////////////////////////
        Font font100 = new Font(unicode, 10, Font.ITALIC, BaseColor.BLUE);
        Document document = new Document();
        PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("REGISTRATION-FORM.pdf"));
        document.open();
        PdfContentByte cb = writer.getDirectContent();
        Font font111 = new Font(Font.FontFamily.COURIER, 16, Font.BOLD, BaseColor.ORANGE);
        Font font110 = new Font(Font.FontFamily.COURIER, 14, Font.NORMAL, BaseColor.GREEN);
        Font font11 = new Font(Font.FontFamily.COURIER, 12, Font.NORMAL, BaseColor.GREEN);
        com.itextpdf.text.Image image2 = com.itextpdf.text.Image
                .getInstance("C:\\smart kid\\src\\frames\\logo.jpg");
        image2.scaleAbsolute(115f, 115f);
        image2.setAbsolutePosition(3, 716);
        Paragraph p = new Paragraph();
        document.add(image2);
        document.add(new Chunk("                                                  ", font1004));
        document.add(new Chunk("ADMISSION FORM", font1005));
        document.add(new Paragraph("                                   SMART KIDS CONVENT SCHOOL", font1004));
        document.add(new Paragraph(
                "                                              Managed By:The Smart Kids Educational Society,"));
        document.add(new Paragraph(
                "                                                                           Reg.No:-00169"));
        document.add(new Paragraph(
                "                                                        413A/23,HEERA NAGAR,GURGAON"));
        document.add(new Paragraph(
                "                                                           MOB:-9911752900  ,  9891929835"));
        document.add(new Paragraph(
                "                                                                                                                   Reg.No"
                        + "   " + Rtf8.getText()));
        document.add(new Paragraph(
                "Admission No." + "                                                                  "
                        + new Date().toString()));
        document.add(new Paragraph("  "));
        Paragraph p1 = new Paragraph();
        p1.add(new Chunk("Certified that                 " + "Son/Daughter of:",
                FontFactory.getFont(FontFactory.COURIER, 11, Font.ITALIC, BaseColor.BLACK)));
        p1.add(new Chunk(Rtf1.getText(), font11));
        document.add(p1);

        document.add(new Paragraph("  "));
        Paragraph p2 = new Paragraph();
        p2.add(new Chunk("Father's Name  :" + Rtf2.getText() + "Mob:-",
                FontFactory.getFont(FontFactory.COURIER, 11, Font.ITALIC, BaseColor.BLACK)));
        p2.add(new Chunk(Rtf2.getText(), font11));
        document.add(p2);

        document.add(new Paragraph("  "));
        Paragraph p3 = new Paragraph();
        p3.add(new Chunk("Mother's Name  :" + Rtf2.getText() + "Mob:-",
                FontFactory.getFont(FontFactory.COURIER, 11, Font.ITALIC, BaseColor.BLACK)));
        p3.add(new Chunk(Rtf2.getText(), font11));
        document.add(p3);
        document.add(new Paragraph("  "));

        Paragraph p4 = new Paragraph();
        p4.add(new Chunk("His/Her Date of birth :" + Rtf2.getText() + "Age",
                FontFactory.getFont(FontFactory.COURIER, 11, Font.ITALIC, BaseColor.BLACK)));
        p4.add(new Chunk(Rtf2.getText(), font11));
        document.add(p4);
        document.add(new Paragraph("  "));

        Paragraph p5 = new Paragraph();
        p5.add(new Chunk("Corrosponding Address                  :",
                FontFactory.getFont(FontFactory.COURIER, 11, Font.ITALIC, BaseColor.BLACK)));
        p5.add(new Chunk("", font11));
        document.add(p5);
        document.add(new Paragraph("  "));

        Paragraph p6 = new Paragraph();
        p6.add(new Chunk("Parmanent Address                  :",
                FontFactory.getFont(FontFactory.COURIER, 11, Font.ITALIC, BaseColor.BLACK)));
        p6.add(new Chunk("", font11));
        document.add(p6);
        document.add(new Paragraph("  "));

        Paragraph p7 = new Paragraph();
        p7.add(new Chunk("Previous School & result                   :",
                FontFactory.getFont(FontFactory.COURIER, 11, Font.ITALIC, BaseColor.BLACK)));
        p7.add(new Chunk("He/She Wants Admmisiion in",
                FontFactory.getFont(FontFactory.COURIER, 11, Font.ITALIC, BaseColor.BLACK)));
        document.add(p7);
        document.add(new Paragraph("  "));
        Paragraph p8 = new Paragraph();
        p8.add(new Chunk("Smart Kids Convent School in                :",
                FontFactory.getFont(FontFactory.COURIER, 11, Font.ITALIC, BaseColor.BLACK)));
        p8.add(new Chunk("Class.He/She will always be regular and punctual to school.",
                FontFactory.getFont(FontFactory.COURIER, 11, Font.ITALIC, BaseColor.BLACK)));
        document.add(p8);
        document.add(new Paragraph("  "));
        Paragraph p9 = new Paragraph();
        p9.add(new Chunk("Please admit him/her              :" + "Signature",
                FontFactory.getFont(FontFactory.COURIER, 11, Font.ITALIC, BaseColor.BLACK)));
        p9.add(new Chunk(
                "                                                                              in" + "Class"
                        + "Parents/Guardian",
                FontFactory.getFont(FontFactory.COURIER, 11, Font.ITALIC, BaseColor.BLACK)));
        document.add(p9);
        document.add(new Paragraph("  "));
        document.add(new Paragraph("  "));
        document.add(new Paragraph("  "));
        document.add(new Paragraph("  "));
        document.add(new Paragraph(
                " Principal(Signature)                                                 Permission of Director",
                FontFactory.getFont(FontFactory.COURIER, 11, Font.ITALIC, BaseColor.BLACK)));
        document.add(new Paragraph("  "));
        document.add(new Paragraph("  "));
        document.add(new Paragraph("  "));
        document.add(new Paragraph("  "));
        document.add(new Paragraph("  "));
        document.add(new Paragraph("NOTE:- FEES WILL NOT BE REFUNDED AFTER ADMISSION."));
        cb.saveState();
        cb.setColorStroke(BaseColor.BLACK);
        cb.rectangle(2, 2, 588, 826);
        cb.stroke();
        cb.restoreState();
        JOptionPane.showMessageDialog(this, "receipt printed..");

        document.close();
        ;
    } catch (Exception ee) {
        JOptionPane.showMessageDialog(this, ee);
    }
}

From source file:frames.main.java

private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {
    if (PRINTMODE.getSelectedIndex() == 0) {
        try {//from   ww w  .j ava2s .  c om

            //mrpno=Integer.parseInt(DTFrpno.getText());
            BaseFont unicode = BaseFont.createFont("c:/windows/fonts/ALGER.ttf", BaseFont.IDENTITY_H,
                    BaseFont.EMBEDDED);
            Font font1003 = new Font(unicode, 18, Font.ITALIC, new BaseColor(139, 0, 0));
            Font font1008 = new Font(unicode, 20, Font.BOLD, new BaseColor(101, 67, 33));
            Font font1004 = new Font(unicode, 14, Font.BOLD, new BaseColor(139, 0, 0));
            Font font1005 = new Font(unicode, 12, Font.UNDERLINE, new BaseColor(255, 0, 0));
            Font font1006 = new Font(unicode, 9, Font.BOLDITALIC, new BaseColor(101, 67, 33));
            Rectangle rect = new RectangleReadOnly(590, 470, 0);
            /////////////////////////////////////
            Font font100 = new Font(unicode, 10, Font.ITALIC, BaseColor.BLUE);
            Document document = new Document();
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("REGISTRATION.pdf"));
            document.setPageSize(rect);
            document.open();
            // PdfContentByte cb = writer.getDirectContent();
            Font font111 = new Font(Font.FontFamily.COURIER, 16, Font.BOLD, BaseColor.ORANGE);
            com.itextpdf.text.Image image2 = com.itextpdf.text.Image
                    .getInstance("C:\\smart kid\\src\\frames\\logo.jpg");
            image2.scaleAbsolute(115f, 115f);
            image2.setAbsolutePosition(2, 350);
            document.add(image2);
            document.add(new Chunk(
                    "                                                                                         ",
                    font100));
            document.add(new Chunk("RECEIPT", font1005));
            //document.add(p);
            // document.add(new Paragraph( ));
            document.add(new Paragraph(
                    "                                  SMART KID CONVENT SCHOOL                 ", font1003));
            // document.add(new Chunk("                          SMART KID CONVENT SCHOOL                 ",font1003));
            // document.add(new Chunk("                                                              413A/23,HEERA NAGAR GURGAON.                        ",font100));
            document.add(new Paragraph(
                    "                                                                  413A/23,HEERA NAGAR GURGAON.                        ",
                    font100));
            // document.add(new Chunk("                                                                                            ph:9911752900,9891929835                 ",font100));
            document.add(new Paragraph(
                    "                                                                     ph:9911752900,9891929835                 ",
                    font100));
            // document.add(new Chunk("                                                          E-mail:info.smartkids@gmail.com",FontFactory.getFont(FontFactory.COURIER,9,Font.BOLDITALIC,BaseColor.DARK_GRAY)));
            document.add(new Paragraph("                                  E-mail:info.smartkids@gmail.com",
                    FontFactory.getFont(FontFactory.COURIER, 9, Font.BOLDITALIC, BaseColor.DARK_GRAY)));

            document.add(new Paragraph("  "));
            PdfPTable table1 = new PdfPTable(4);
            PdfPCell c = new PdfPCell(new Paragraph("STUDENT PARTICULARS"));
            c.setColspan(4);
            c.setBackgroundColor(BaseColor.GREEN);
            c.setHorizontalAlignment(Element.ALIGN_CENTER);
            table1.addCell(c);
            table1.addCell("Student Name:");
            table1.addCell(new PdfPCell(new Paragraph(Dtf2.getText(),
                    FontFactory.getFont(FontFactory.COURIER, 12, Font.BOLDITALIC, BaseColor.GREEN))));

            table1.addCell("Class:");
            table1.addCell(new Paragraph((String) Dtf5.getText(),
                    FontFactory.getFont(FontFactory.COURIER, 12, Font.BOLDITALIC, BaseColor.GREEN)));
            table1.addCell("Section:");
            table1.addCell(new Paragraph((String) Dtf22.getText() + "     " + "Phone.:" + Dtf20.getText(),
                    FontFactory.getFont(FontFactory.COURIER, 12, Font.BOLDITALIC, BaseColor.GREEN)));
            table1.addCell("Registration No:");
            table1.addCell(new PdfPCell(new Paragraph(Dtf1.getText(),
                    FontFactory.getFont(FontFactory.COURIER, 12, Font.BOLDITALIC, BaseColor.GREEN))));
            table1.addCell("Session:");
            table1.addCell(new Paragraph("NA",
                    FontFactory.getFont(FontFactory.COURIER, 12, Font.BOLDITALIC, BaseColor.GREEN)));
            table1.addCell("Month:");
            table1.addCell(new Paragraph((String) Djc1.getSelectedItem(),
                    FontFactory.getFont(FontFactory.COURIER, 12, Font.BOLDITALIC, BaseColor.GREEN)));
            float[] ColumnWidths1 = new float[] { 12f, 19f, 10f, 24f };
            table1.setWidths(ColumnWidths1);
            table1.setWidthPercentage(113);
            document.add(table1);

            // document.add(new Paragraph("  "));

            PdfPTable table = new PdfPTable(5);
            PdfPCell cc = new PdfPCell(new Paragraph("FEE INFORMATION"));
            cc.setBackgroundColor(BaseColor.GREEN);
            cc.setHorizontalAlignment(Element.ALIGN_CENTER);
            cc.setColspan(5);
            table.addCell(cc);
            PdfPCell cell99 = new PdfPCell(new Paragraph("Sl No",
                    FontFactory.getFont(FontFactory.COURIER, 10, Font.NORMAL, BaseColor.BLACK)));
            PdfPCell cell90 = new PdfPCell(new Paragraph("Particulars",
                    FontFactory.getFont(FontFactory.COURIER, 10, Font.NORMAL, BaseColor.BLACK)));
            PdfPCell cell91 = new PdfPCell(new Paragraph("Cash",
                    FontFactory.getFont(FontFactory.COURIER, 10, Font.NORMAL, BaseColor.BLACK)));
            PdfPCell cell92 = new PdfPCell(new Paragraph("Cheque",
                    FontFactory.getFont(FontFactory.COURIER, 10, Font.NORMAL, BaseColor.BLACK)));
            PdfPCell cell93 = new PdfPCell(new Paragraph("Total",
                    FontFactory.getFont(FontFactory.COURIER, 10, Font.NORMAL, BaseColor.BLACK)));
            table.addCell(cell99);
            table.addCell(cell90);
            table.addCell(cell91);
            table.addCell(cell92);
            table.addCell(cell93);
            table.addCell("1");
            PdfPCell cell1 = new PdfPCell(new Paragraph("Registration Fee",
                    FontFactory.getFont(FontFactory.COURIER, 9, Font.NORMAL, BaseColor.BLACK)));
            table.addCell(cell1);
            table.addCell(Dtf11.getText());
            table.addCell(" ");
            table.addCell(" ");
            table.addCell("2");
            PdfPCell cell2 = new PdfPCell(new Paragraph("Admission/Re admission fee",
                    FontFactory.getFont(FontFactory.COURIER, 9, Font.NORMAL, BaseColor.BLACK)));
            table.addCell(cell2);
            table.addCell(Dtf12.getText());
            table.addCell("  ");
            table.addCell(" ");
            table.addCell("3");
            PdfPCell cell3 = new PdfPCell(new Paragraph("Building fee",
                    FontFactory.getFont(FontFactory.COURIER, 9, Font.NORMAL, BaseColor.BLACK)));
            table.addCell(cell3);
            table.addCell(Dtf13.getText());
            table.addCell(" ");
            table.addCell(" ");
            table.addCell("4");
            PdfPCell cell4 = new PdfPCell(new Paragraph("Annual Charge",
                    FontFactory.getFont(FontFactory.COURIER, 9, Font.NORMAL, BaseColor.BLACK)));
            table.addCell(cell4);
            table.addCell(Dtf14.getText());
            table.addCell(" ");
            table.addCell(" ");
            table.addCell("5");
            PdfPCell cell14 = new PdfPCell(new Paragraph("Security (Refundable)",
                    FontFactory.getFont(FontFactory.COURIER, 9, Font.NORMAL, BaseColor.BLACK)));
            table.addCell(cell14);
            table.addCell(Dtf17.getText());
            table.addCell(" ");
            table.addCell(" ");
            table.addCell("6");
            PdfPCell cell5 = new PdfPCell(new Paragraph("Tution",
                    FontFactory.getFont(FontFactory.COURIER, 9, Font.NORMAL, BaseColor.BLACK)));
            table.addCell(cell5);
            table.addCell(Dtf6.getText());
            table.addCell(" ");
            table.addCell(" ");
            table.addCell("7");
            PdfPCell cell6 = new PdfPCell(new Paragraph("Total pupils fund",
                    FontFactory.getFont(FontFactory.COURIER, 9, Font.NORMAL, BaseColor.BLACK)));
            table.addCell(cell6);
            table.addCell(Dtf16.getText());
            table.addCell(" ");
            table.addCell(" ");
            table.addCell("8");
            PdfPCell cell7 = new PdfPCell(new Paragraph("Computer Fee",
                    FontFactory.getFont(FontFactory.COURIER, 9, Font.NORMAL, BaseColor.BLACK)));
            table.addCell(cell7);
            table.addCell(Dtf7.getText());
            table.addCell(" ");
            table.addCell(" ");
            table.addCell("9");
            PdfPCell cell8 = new PdfPCell(new Paragraph("Sports Fee",
                    FontFactory.getFont(FontFactory.COURIER, 9, Font.NORMAL, BaseColor.BLACK)));
            table.addCell(cell8);
            table.addCell(Dtf15.getText());
            table.addCell(" ");
            table.addCell(" ");
            table.addCell("10");
            PdfPCell cell9 = new PdfPCell(new Paragraph("House exam Fee",
                    FontFactory.getFont(FontFactory.COURIER, 9, Font.NORMAL, BaseColor.BLACK)));
            table.addCell(cell9);
            table.addCell(Dtf8.getText());
            table.addCell(" ");
            table.addCell(" ");
            table.addCell("11");
            PdfPCell cell10 = new PdfPCell(new Paragraph("Conveyance Charge",
                    FontFactory.getFont(FontFactory.COURIER, 9, Font.NORMAL, BaseColor.BLACK)));
            table.addCell(cell10);
            table.addCell(Dtf18.getText());
            table.addCell(" ");
            //table.addCell(" ");
            table.addCell("");
            PdfPCell cell12 = new PdfPCell(new Paragraph("12",
                    FontFactory.getFont(FontFactory.COURIER, 9, Font.BOLD, BaseColor.BLACK)));
            PdfPCell cell13 = new PdfPCell(new Paragraph("Grand Total",
                    FontFactory.getFont(FontFactory.COURIER, 9, Font.BOLD, BaseColor.BLACK)));

            table.addCell(cell12);
            table.addCell(cell13);

            table.addCell(
                    String.valueOf((Integer.parseInt(Dtf11.getText())) + (Integer.parseInt(Dtf12.getText()))
                            + (Integer.parseInt(Dtf13.getText())) + (Integer.parseInt(Dtf14.getText()))
                            + (Integer.parseInt(Dtf17.getText())) + (Integer.parseInt(Dtf6.getText()))
                            + (Integer.parseInt(Dtf16.getText())) + (Integer.parseInt(Dtf7.getText()))
                            + (Integer.parseInt(Dtf15.getText())) + (Integer.parseInt(Dtf8.getText()))
                            + (Integer.parseInt(Dtf18.getText())) + (Integer.parseInt(Dtf9.getText()))));

            float[] ColumnWidths = new float[] { 8f, 25f, 11f, 10f, 10f };
            table.setWidths(ColumnWidths);
            table.setWidthPercentage(113);
            table.completeRow();
            document.add(table);
            document.add(new Chunk(
                    "# Fee once paid is not refundable .                      For Smart kid convent school     Signature    "));
            //document.add(new Chunk("# The monthly fee has to be deposited before 10th of every month                            Signature "));
            JOptionPane.showMessageDialog(this, "receipt printed..");

            Dtf21.setText(String.valueOf(Integer.parseInt(Dtf21.getText()) + 1));
            document.close();
            ;
        } catch (Exception ee) {
            JOptionPane.showMessageDialog(this, ee);
        }
    } else if (PRINTMODE.getSelectedIndex() == 1) {
        try {

            //mrpno=Integer.parseInt(DTFrpno.getText());
            BaseFont unicode = BaseFont.createFont("c:/windows/fonts/ALGER.ttf", BaseFont.IDENTITY_H,
                    BaseFont.EMBEDDED);
            Font font1003 = new Font(unicode, 18, Font.ITALIC, new BaseColor(139, 0, 0));
            Font font1008 = new Font(unicode, 20, Font.BOLD, new BaseColor(101, 67, 33));
            Font font1004 = new Font(unicode, 14, Font.BOLD, new BaseColor(139, 0, 0));
            Font font1005 = new Font(unicode, 12, Font.UNDERLINE, new BaseColor(255, 0, 0));
            Font font1006 = new Font(unicode, 9, Font.BOLDITALIC, new BaseColor(101, 67, 33));
            Rectangle rect = new RectangleReadOnly(590, 460, 0);
            /////////////////////////////////////
            Font font100 = new Font(unicode, 10, Font.ITALIC, BaseColor.BLUE);
            Document document = new Document();
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("Feeslipp(MONTHLY).pdf"));
            document.setPageSize(rect);
            document.open();
            // PdfContentByte cb = writer.getDirectContent();
            Font font111 = new Font(Font.FontFamily.COURIER, 16, Font.BOLD, BaseColor.ORANGE);
            com.itextpdf.text.Image image2 = com.itextpdf.text.Image
                    .getInstance("C:\\smart kid\\src\\frames\\logo.jpg");
            image2.scaleAbsolute(115f, 115f);
            image2.setAbsolutePosition(2, 350);
            document.add(image2);
            Paragraph p = new Paragraph();
            p.add(new Chunk("                                                                      "));
            //p.add(new Chunk("RECEIPT",font1005));
            //document.add(p);
            document.add(new Chunk("                  RECEIPT", font1003));
            document.add(new Paragraph("                             SMART KID CONVENT SCHOOL                 ",
                    font1003));
            // document.add(new Chunk("                          SMART KID CONVENT SCHOOL                 ",font1003));
            // document.add(new Chunk("                                                              413A/23,HEERA NAGAR GURGAON.                        ",font100));
            document.add(new Paragraph(
                    "                                                              413A/23,HEERA NAGAR GURGAON.                        ",
                    font100));
            // document.add(new Chunk("                                                                                            ph:9911752900,9891929835                 ",font100));
            document.add(new Paragraph(
                    "                                                                  ph:9911752900,9891929835                 ",
                    font100));
            // document.add(new Chunk("                                                          E-mail:info.smartkids@gmail.com",FontFactory.getFont(FontFactory.COURIER,9,Font.BOLDITALIC,BaseColor.DARK_GRAY)));
            document.add(new Paragraph("                                 E-mail:info.smartkids@gmail.com",
                    FontFactory.getFont(FontFactory.COURIER, 9, Font.BOLDITALIC, BaseColor.DARK_GRAY)));
            document.add(new Paragraph("  "));
            PdfPTable table1 = new PdfPTable(4);
            PdfPCell c = new PdfPCell(new Paragraph("STUDENT PARTICULARS"));
            c.setColspan(4);
            c.setBackgroundColor(BaseColor.GREEN);
            c.setHorizontalAlignment(Element.ALIGN_CENTER);
            table1.addCell(c);
            table1.addCell("Student Name:");
            table1.addCell(new PdfPCell(new Paragraph(Dtf2.getText(),
                    FontFactory.getFont(FontFactory.COURIER, 12, Font.BOLDITALIC, BaseColor.GREEN))));
            table1.addCell("Class:");
            table1.addCell(new Paragraph(Dtf5.getText(),
                    FontFactory.getFont(FontFactory.COURIER, 12, Font.BOLDITALIC, BaseColor.GREEN)));
            table1.addCell("Section:");
            table1.addCell(new Paragraph(Dtf21.getText() + "     " + "Phone.:" + Dtf20.getText(),
                    FontFactory.getFont(FontFactory.COURIER, 12, Font.BOLDITALIC, BaseColor.GREEN)));
            table1.addCell("Registration No:");
            table1.addCell(new PdfPCell(new Paragraph(Dtf1.getText(),
                    FontFactory.getFont(FontFactory.COURIER, 12, Font.BOLDITALIC, BaseColor.GREEN))));
            table1.addCell("Month:");
            table1.addCell(new Paragraph((String) Djc1.getSelectedItem(),
                    FontFactory.getFont(FontFactory.COURIER, 12, Font.BOLDITALIC, BaseColor.GREEN)));
            float[] ColumnWidths1 = new float[] { 12f, 19f, 10f, 24f };
            table1.setWidths(ColumnWidths1);
            table1.setWidthPercentage(113);
            document.add(table1);

            document.add(new Paragraph("  "));
            PdfPTable table = new PdfPTable(5);
            PdfPCell cc = new PdfPCell(new Paragraph("FEE INFORMATION"));
            cc.setBackgroundColor(BaseColor.GREEN);
            cc.setHorizontalAlignment(Element.ALIGN_CENTER);
            cc.setColspan(5);
            table.addCell(cc);
            PdfPCell cell99 = new PdfPCell(new Paragraph("Sl No",
                    FontFactory.getFont(FontFactory.COURIER, 10, Font.NORMAL, BaseColor.BLACK)));
            PdfPCell cell90 = new PdfPCell(new Paragraph("Particulars",
                    FontFactory.getFont(FontFactory.COURIER, 10, Font.NORMAL, BaseColor.BLACK)));
            PdfPCell cell91 = new PdfPCell(new Paragraph("Cash",
                    FontFactory.getFont(FontFactory.COURIER, 10, Font.NORMAL, BaseColor.BLACK)));
            PdfPCell cell92 = new PdfPCell(new Paragraph("Cheque",
                    FontFactory.getFont(FontFactory.COURIER, 10, Font.NORMAL, BaseColor.BLACK)));
            PdfPCell cell93 = new PdfPCell(new Paragraph("Total",
                    FontFactory.getFont(FontFactory.COURIER, 10, Font.NORMAL, BaseColor.BLACK)));
            table.addCell(cell99);
            table.addCell(cell90);
            table.addCell(cell91);
            table.addCell(cell92);
            table.addCell(cell93);
            table.addCell("1");
            PdfPCell cell1 = new PdfPCell(new Paragraph("TUITION FEE",
                    FontFactory.getFont(FontFactory.COURIER, 9, Font.NORMAL, BaseColor.BLACK)));
            table.addCell(cell1);
            table.addCell(Dtf6.getText());
            table.addCell(" ");
            table.addCell(" ");
            table.addCell("2");
            PdfPCell cell2 = new PdfPCell(new Paragraph("COMPUTER FEE",
                    FontFactory.getFont(FontFactory.COURIER, 9, Font.NORMAL, BaseColor.BLACK)));
            table.addCell(cell2);
            table.addCell(Dtf7.getText());
            table.addCell("  ");
            table.addCell(" ");
            table.addCell("3");
            PdfPCell cell5 = new PdfPCell(new Paragraph("HOUSE EXAM FEE",
                    FontFactory.getFont(FontFactory.COURIER, 9, Font.NORMAL, BaseColor.BLACK)));
            table.addCell(cell5);
            table.addCell(Dtf8.getText());
            table.addCell(" ");
            table.addCell(" ");
            table.addCell("4");
            PdfPCell cell6 = new PdfPCell(new Paragraph("FINES",
                    FontFactory.getFont(FontFactory.COURIER, 9, Font.NORMAL, BaseColor.BLACK)));
            table.addCell(cell6);
            table.addCell(Dtf9.getText());
            table.addCell(" ");
            table.addCell(" ");
            table.addCell("5");
            PdfPCell cell7 = new PdfPCell(new Paragraph("OTHERS",
                    FontFactory.getFont(FontFactory.COURIER, 9, Font.NORMAL, BaseColor.BLACK)));
            table.addCell(cell7);
            table.addCell(Dtf10.getText());
            table.addCell(" ");

            table.addCell("");

            PdfPCell cell9 = new PdfPCell(new Paragraph("6",
                    FontFactory.getFont(FontFactory.COURIER, 9, Font.BOLD, BaseColor.BLACK)));
            PdfPCell cell8 = new PdfPCell(new Paragraph("Grand Total",
                    FontFactory.getFont(FontFactory.COURIER, 9, Font.BOLD, BaseColor.BLACK)));

            table.addCell(cell7);
            table.addCell(cell8);
            table.addCell(String.valueOf((Integer.parseInt(Dtf6.getText())) + (Integer.parseInt(Dtf7.getText()))
                    + (Integer.parseInt(Dtf8.getText())) + (Integer.parseInt(Dtf9.getText()))
                    + (Integer.parseInt(Dtf10.getText()))));

            float[] ColumnWidths = new float[] { 8f, 25f, 11f, 10f, 10f };
            table.setWidths(ColumnWidths);
            table.setWidthPercentage(113);
            table.completeRow();
            document.add(table);
            document.add(new Chunk(
                    "# Fee once paid is not refundable .                                                   For smart kid convent School     "));
            document.add(new Chunk(
                    "# The monthly fee has to be deposited before 10th of every month                            Signature "));
            JOptionPane.showMessageDialog(this, "receipt printed..");

            Dtf21.setText(String.valueOf(Integer.parseInt(Dtf21.getText()) + 1));
            document.close();
            ;
        } catch (Exception ee) {
            JOptionPane.showMessageDialog(this, ee);
        }
    } // TODO add your handling code here:
}

From source file:frames.main.java

private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) {
    try {/* w ww  .  j  av a 2s.  co  m*/

        BaseFont unicode = BaseFont.createFont("c:/windows/fonts/ALGER.ttf", BaseFont.IDENTITY_H,
                BaseFont.EMBEDDED);

        // Font font11113 = new Font(unicode, 16, Font.BOLD,BaseColor(2,2,2));
        ///////////////////////////////////////////////dark brown//////////////////////////////////////////////////////
        Font font1003 = new Font(unicode, 16, Font.BOLD, new BaseColor(101, 67, 33));
        Font font1008 = new Font(unicode, 20, Font.BOLD, new BaseColor(101, 67, 33));
        /////////////////////////////////////
        ///////////////////////////////////////////////dark red//////////////////////////////////////////////////////
        Font font1004 = new Font(unicode, 14, Font.BOLD, new BaseColor(139, 0, 0));
        Font font1005 = new Font(unicode, 14, Font.BOLD, new BaseColor(255, 0, 0));

        /////////////////////////////////////
        Font font100 = new Font(unicode, 8, Font.ITALIC, BaseColor.BLUE);
        Document document = new Document();
        PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("SMART-TC.pdf"));
        document.open();
        PdfContentByte cb = writer.getDirectContent();
        Font font111 = new Font(Font.FontFamily.COURIER, 16, Font.BOLD, BaseColor.ORANGE);
        com.itextpdf.text.Image image2 = com.itextpdf.text.Image
                .getInstance("C:\\smart kid\\src\\frames\\logo.jpg");
        image2.scaleAbsolute(125f, 125f);
        image2.setAbsolutePosition(31, 700);
        document.add(image2);
        com.itextpdf.text.Image ing = com.itextpdf.text.Image.getInstance("C:\\smart kid\\src\\frames\\BC.jpg");
        ing.setAbsolutePosition(1, 200);
        document.add(ing);
        Font font1111 = new Font(unicode, 16, Font.BOLD, BaseColor.ORANGE);
        Font font11111 = new Font(unicode, 14, Font.BOLD, BaseColor.ORANGE);
        java.awt.Font awtPlainFont = new java.awt.Font("ALGERIAN", java.awt.Font.PLAIN, 10);
        document.add(new Paragraph("                                    SMART KIDS CONVENT SCHOOL", font1008));
        document.add(new Paragraph(
                "                                                   HEERA NAGAR (GURGAON)         ", font1003));
        document.add(
                new Chunk("                                       SCHOLOR'S REGISTER AND TRANSFER CERTIFICATE",
                        font1005));
        document.add(new Paragraph("                                    "));
        document.add(new Paragraph(
                "----------------------------------------------------------------------------------------------------------------------------------"));
        document.add(new Paragraph("                            ", font111));
        Font font41 = new Font(Font.FontFamily.HELVETICA, 9, Font.BOLD, new BaseColor(0, 0, 0));
        Font font23 = new Font(Font.FontFamily.HELVETICA, 12, Font.BOLD, new BaseColor(92, 64, 51));
        Font font1 = new Font(Font.FontFamily.HELVETICA, 10, Font.BOLD, new BaseColor(0, 0, 0));
        Font font11 = new Font(Font.FontFamily.HELVETICA, 12, Font.ITALIC, new BaseColor(148, 0, 211));
        Font font31 = new Font(Font.FontFamily.HELVETICA, 10, Font.BOLD, new BaseColor(990000));
        Font font2 = new Font(Font.FontFamily.COURIER, 18, Font.ITALIC | Font.UNDERLINE);
        Font font3 = new Font(Font.FontFamily.HELVETICA, 10, Font.BOLD, new BaseColor(255, 255, 200));

        document.add(new Paragraph(
                "Ref No:  " + TC16.getText() + "                         " + new java.util.Date().toString(),
                FontFactory.getFont(FontFactory.COURIER, 12, Font.NORMAL, BaseColor.BLACK)));
        document.add(new Paragraph("    "));
        String ho4 = TC1.getText();
        Paragraph p1 = new Paragraph();
        p1.add(new Chunk("NAME OF STUDENT        :",
                FontFactory.getFont(FontFactory.COURIER, 12, Font.NORMAL, BaseColor.BLACK)));
        p1.add(new Chunk(ho4, font11));
        document.add(p1);

        String ho5 = TC2.getText();
        Paragraph p2 = new Paragraph();
        p2.add(new Chunk("FATHER'S NAME          :",
                FontFactory.getFont(FontFactory.COURIER, 12, Font.NORMAL, BaseColor.BLACK)));
        p2.add(new Chunk(ho5, font11));
        document.add(p2);

        String ho6 = TC3.getText();
        Paragraph p93 = new Paragraph();
        p93.add(new Chunk("MOTHER'S NAME          :",
                FontFactory.getFont(FontFactory.COURIER, 12, Font.NORMAL, BaseColor.BLACK)));
        p93.add(new Chunk(ho6, font11));
        document.add(p93);

        Font font15 = new Font(Font.FontFamily.HELVETICA, 10, Font.BOLD, new BaseColor(0, 0, 0));
        String ho8 = TC1.getText();
        String tt = TC4.getText();
        Paragraph p4 = new Paragraph();

        p4.add(new Chunk("RELIGION               :",
                FontFactory.getFont(FontFactory.COURIER, 12, Font.NORMAL, BaseColor.BLACK)));
        p4.add(new Chunk(tt, font11));

        document.add(p4);
        // document.add(new Paragraph("                                            ",font1003));
        String kk = TC5.getText();
        Paragraph p5 = new Paragraph();
        p5.add(new Chunk("CASTE OF SCHOLOR       :",
                FontFactory.getFont(FontFactory.COURIER, 12, Font.NORMAL, BaseColor.BLACK)));
        p5.add(new Chunk(kk, font11));
        document.add(p5);

        String ho10 = TC10.getText();
        Paragraph p6 = new Paragraph();
        p6.add(new Chunk("ADDRESS                :",
                FontFactory.getFont(FontFactory.COURIER, 12, Font.NORMAL, BaseColor.BLACK)));
        p6.add(new Chunk(ho10, font11));
        document.add(p6);

        Paragraph p8 = new Paragraph();
        p8.add(new Chunk("DATE OF BIRTH          :",
                FontFactory.getFont(FontFactory.COURIER, 12, Font.NORMAL, BaseColor.BLACK)));
        p8.add(new Chunk(TC9.getText(), font11));
        document.add(p8);
        Paragraph p9 = new Paragraph();
        p9.add(new Chunk("SECTION                :",
                FontFactory.getFont(FontFactory.COURIER, 12, Font.NORMAL, BaseColor.BLACK)));
        p9.add(new Chunk(TC7.getText(), font11));
        document.add(p9);
        Paragraph p10 = new Paragraph();
        p10.add(new Chunk("REGISTRATION NO:       :",
                FontFactory.getFont(FontFactory.COURIER, 12, Font.NORMAL, BaseColor.BLACK)));
        p10.add(new Chunk(TC8.getText(), font11));
        document.add(p10);
        document.add(new Paragraph("                                       "));

        PdfPTable table = new PdfPTable(8);
        String vacume = "";
        table.addCell("Class");
        table.addCell("Date of Admission");
        table.addCell("Date of Promotion");
        table.addCell("Date of Removal");
        table.addCell("Cause of Removal");
        table.addCell("Year");
        table.addCell("Conduct and Work");
        table.addCell("Sign");

        PdfPCell cell10 = new PdfPCell(new Paragraph("NURSERY", font100));
        table.addCell(cell10);
        if (TC6.getSelectedIndex() == 0) {
            PdfPCell cell11 = new PdfPCell(new Paragraph(TC11.getText(), font100));
            PdfPCell cell12 = new PdfPCell(
                    new Paragraph(((JTextField) TC12.getDateEditor().getUiComponent()).getText(), font100));
            PdfPCell cell13 = new PdfPCell(
                    new Paragraph(((JTextField) TC13.getDateEditor().getUiComponent()).getText(), font100));
            ;
            PdfPCell cell14 = new PdfPCell(new Paragraph(TC14.getText(), font100));
            PdfPCell cell15 = new PdfPCell(new Paragraph((String) TC15.getSelectedItem(), font100));
            PdfPCell cell16 = new PdfPCell(new Paragraph(TC17.getText(), font100));
            table.addCell(cell11);
            table.addCell(cell12);
            table.addCell(cell13);
            table.addCell(cell14);
            table.addCell(cell15);
            table.addCell(cell16);
            table.addCell("");
        } else {
            for (int i = 0; i < 7; i++)
                table.addCell(vacume);
        }

        PdfPCell cell111 = new PdfPCell(new Paragraph("LKG", font100));
        table.addCell(cell111);
        if (TC6.getSelectedIndex() == 1) {
            PdfPCell cell11 = new PdfPCell(new Paragraph(TC11.getText(), font100));
            PdfPCell cell12 = new PdfPCell(
                    new Paragraph(((JTextField) TC12.getDateEditor().getUiComponent()).getText(), font100));
            PdfPCell cell13 = new PdfPCell(
                    new Paragraph(((JTextField) TC13.getDateEditor().getUiComponent()).getText(), font100));
            ;
            PdfPCell cell14 = new PdfPCell(new Paragraph(TC14.getText(), font100));
            PdfPCell cell15 = new PdfPCell(new Paragraph((String) TC15.getSelectedItem(), font100));
            PdfPCell cell16 = new PdfPCell(new Paragraph(TC17.getText(), font100));
            table.addCell(cell11);
            table.addCell(cell12);
            table.addCell(cell13);
            table.addCell(cell14);
            table.addCell(cell15);
            table.addCell(cell16);
            table.addCell("");
        } else {
            for (int i = 0; i < 7; i++)
                table.addCell(vacume);
        }

        PdfPCell cell1 = new PdfPCell(new Paragraph("UKG", font100));
        table.addCell(cell1);
        if (TC6.getSelectedIndex() == 2) {
            PdfPCell cell11 = new PdfPCell(new Paragraph(TC11.getText(), font100));
            PdfPCell cell12 = new PdfPCell(
                    new Paragraph(((JTextField) TC12.getDateEditor().getUiComponent()).getText(), font100));
            PdfPCell cell13 = new PdfPCell(
                    new Paragraph(((JTextField) TC13.getDateEditor().getUiComponent()).getText(), font100));
            ;
            PdfPCell cell14 = new PdfPCell(new Paragraph(TC14.getText(), font100));
            PdfPCell cell15 = new PdfPCell(new Paragraph((String) TC15.getSelectedItem(), font100));
            PdfPCell cell16 = new PdfPCell(new Paragraph(TC17.getText(), font100));
            table.addCell(cell11);
            table.addCell(cell12);
            table.addCell(cell13);
            table.addCell(cell14);
            table.addCell(cell15);
            table.addCell(cell16);
            table.addCell("");
        } else {
            for (int i = 0; i < 7; i++)
                table.addCell(vacume);
        }
        PdfPCell cell2 = new PdfPCell(new Paragraph("STD-1", font100));
        table.addCell(cell2);
        if (TC6.getSelectedIndex() == 3) {
            PdfPCell cell11 = new PdfPCell(new Paragraph(TC11.getText(), font100));
            PdfPCell cell12 = new PdfPCell(
                    new Paragraph(((JTextField) TC12.getDateEditor().getUiComponent()).getText(), font100));
            PdfPCell cell13 = new PdfPCell(
                    new Paragraph(((JTextField) TC13.getDateEditor().getUiComponent()).getText(), font100));
            ;
            PdfPCell cell14 = new PdfPCell(new Paragraph(TC14.getText(), font100));
            PdfPCell cell15 = new PdfPCell(new Paragraph((String) TC15.getSelectedItem(), font100));
            PdfPCell cell16 = new PdfPCell(new Paragraph(TC17.getText(), font100));
            table.addCell(cell11);
            table.addCell(cell12);
            table.addCell(cell13);
            table.addCell(cell14);
            table.addCell(cell15);
            table.addCell(cell16);
            table.addCell("");
        } else {
            for (int i = 0; i < 7; i++)
                table.addCell(vacume);
        }

        PdfPCell cell3 = new PdfPCell(new Paragraph("STD-2", font100));
        table.addCell(cell3);
        if (TC6.getSelectedIndex() == 4) {
            PdfPCell cell11 = new PdfPCell(new Paragraph(TC11.getText(), font100));
            PdfPCell cell12 = new PdfPCell(
                    new Paragraph(((JTextField) TC12.getDateEditor().getUiComponent()).getText(), font100));
            PdfPCell cell13 = new PdfPCell(
                    new Paragraph(((JTextField) TC13.getDateEditor().getUiComponent()).getText(), font100));
            ;
            PdfPCell cell14 = new PdfPCell(new Paragraph(TC14.getText(), font100));
            PdfPCell cell15 = new PdfPCell(new Paragraph((String) TC15.getSelectedItem(), font100));
            PdfPCell cell16 = new PdfPCell(new Paragraph(TC17.getText(), font100));
            table.addCell(cell11);
            table.addCell(cell12);
            table.addCell(cell13);
            table.addCell(cell14);
            table.addCell(cell15);
            table.addCell(cell16);
            table.addCell("");
        } else {
            for (int i = 0; i < 7; i++)
                table.addCell(vacume);
        }

        PdfPCell cell4 = new PdfPCell(new Paragraph("STD-3", font100));
        table.addCell(cell4);
        if (TC6.getSelectedIndex() == 5) {
            PdfPCell cell11 = new PdfPCell(new Paragraph(TC11.getText(), font100));
            PdfPCell cell12 = new PdfPCell(
                    new Paragraph(((JTextField) TC12.getDateEditor().getUiComponent()).getText(), font100));
            PdfPCell cell13 = new PdfPCell(
                    new Paragraph(((JTextField) TC13.getDateEditor().getUiComponent()).getText(), font100));
            ;
            PdfPCell cell14 = new PdfPCell(new Paragraph(TC14.getText(), font100));
            PdfPCell cell15 = new PdfPCell(new Paragraph((String) TC15.getSelectedItem(), font100));
            PdfPCell cell16 = new PdfPCell(new Paragraph(TC17.getText(), font100));
            table.addCell(cell11);
            table.addCell(cell12);
            table.addCell(cell13);
            table.addCell(cell14);
            table.addCell(cell15);
            table.addCell(cell16);
            table.addCell("");
        } else {
            for (int i = 0; i < 7; i++)
                table.addCell(vacume);
        }

        PdfPCell cell5 = new PdfPCell(new Paragraph("STD-4", font100));
        table.addCell(cell5);
        if (TC6.getSelectedIndex() == 6) {
            PdfPCell cell11 = new PdfPCell(new Paragraph(TC11.getText(), font100));
            PdfPCell cell12 = new PdfPCell(
                    new Paragraph(((JTextField) TC12.getDateEditor().getUiComponent()).getText(), font100));
            PdfPCell cell13 = new PdfPCell(
                    new Paragraph(((JTextField) TC13.getDateEditor().getUiComponent()).getText(), font100));
            ;
            PdfPCell cell14 = new PdfPCell(new Paragraph(TC14.getText(), font100));
            PdfPCell cell15 = new PdfPCell(new Paragraph((String) TC15.getSelectedItem(), font100));
            PdfPCell cell16 = new PdfPCell(new Paragraph(TC17.getText(), font100));
            table.addCell(cell11);
            table.addCell(cell12);
            table.addCell(cell13);
            table.addCell(cell14);
            table.addCell(cell15);
            table.addCell(cell16);
            table.addCell("");
        } else {
            for (int i = 0; i < 7; i++)
                table.addCell(vacume);
        }
        PdfPCell cell6 = new PdfPCell(new Paragraph("STD-5", font100));
        table.addCell(cell6);
        if (TC6.getSelectedIndex() == 7) {
            PdfPCell cell11 = new PdfPCell(new Paragraph(TC11.getText(), font100));
            PdfPCell cell12 = new PdfPCell(
                    new Paragraph(((JTextField) TC12.getDateEditor().getUiComponent()).getText(), font100));
            PdfPCell cell13 = new PdfPCell(
                    new Paragraph(((JTextField) TC13.getDateEditor().getUiComponent()).getText(), font100));
            ;
            PdfPCell cell14 = new PdfPCell(new Paragraph(TC14.getText(), font100));
            PdfPCell cell15 = new PdfPCell(new Paragraph((String) TC15.getSelectedItem(), font100));
            PdfPCell cell16 = new PdfPCell(new Paragraph(TC17.getText(), font100));
            table.addCell(cell11);
            table.addCell(cell12);
            table.addCell(cell13);
            table.addCell(cell14);
            table.addCell(cell15);
            table.addCell(cell16);
            table.addCell("");
        } else {
            for (int i = 0; i < 7; i++)
                table.addCell(vacume);
        }
        PdfPCell cell8 = new PdfPCell(new Paragraph("STD-6", font100));
        table.addCell(cell8);
        if (TC6.getSelectedIndex() == 8) {
            PdfPCell cell11 = new PdfPCell(new Paragraph(TC11.getText(), font100));
            PdfPCell cell12 = new PdfPCell(
                    new Paragraph(((JTextField) TC12.getDateEditor().getUiComponent()).getText(), font100));
            PdfPCell cell13 = new PdfPCell(
                    new Paragraph(((JTextField) TC13.getDateEditor().getUiComponent()).getText(), font100));
            ;
            PdfPCell cell14 = new PdfPCell(new Paragraph(TC14.getText(), font100));
            PdfPCell cell15 = new PdfPCell(new Paragraph((String) TC15.getSelectedItem(), font100));
            PdfPCell cell16 = new PdfPCell(new Paragraph(TC17.getText(), font100));
            table.addCell(cell11);
            table.addCell(cell12);
            table.addCell(cell13);
            table.addCell(cell14);
            table.addCell(cell15);
            table.addCell(cell16);
            table.addCell("");
        } else {
            for (int i = 0; i < 7; i++)
                table.addCell(vacume);
        }

        PdfPCell cell9 = new PdfPCell(new Paragraph("STD-7", font100));
        table.addCell(cell9);
        if (TC6.getSelectedIndex() == 9) {
            PdfPCell cell11 = new PdfPCell(new Paragraph(TC11.getText(), font100));
            PdfPCell cell12 = new PdfPCell(
                    new Paragraph(((JTextField) TC12.getDateEditor().getUiComponent()).getText(), font100));
            PdfPCell cell13 = new PdfPCell(
                    new Paragraph(((JTextField) TC13.getDateEditor().getUiComponent()).getText(), font100));
            ;
            PdfPCell cell14 = new PdfPCell(new Paragraph(TC14.getText(), font100));
            PdfPCell cell15 = new PdfPCell(new Paragraph((String) TC15.getSelectedItem(), font100));
            PdfPCell cell16 = new PdfPCell(new Paragraph(TC17.getText(), font100));
            table.addCell(cell11);
            table.addCell(cell12);
            table.addCell(cell13);
            table.addCell(cell14);
            table.addCell(cell15);
            table.addCell(cell16);
            table.addCell("");
        } else {
            for (int i = 0; i < 7; i++)
                table.addCell(vacume);
        }

        PdfPCell cell18 = new PdfPCell(new Paragraph("STD-8", font100));
        table.addCell(cell18);
        if (TC6.getSelectedIndex() == 2) {
            PdfPCell cell11 = new PdfPCell(new Paragraph(TC11.getText(), font100));
            PdfPCell cell12 = new PdfPCell(
                    new Paragraph(((JTextField) TC12.getDateEditor().getUiComponent()).getText(), font100));
            PdfPCell cell13 = new PdfPCell(
                    new Paragraph(((JTextField) TC13.getDateEditor().getUiComponent()).getText(), font100));
            ;
            PdfPCell cell14 = new PdfPCell(new Paragraph(TC14.getText(), font100));
            PdfPCell cell15 = new PdfPCell(new Paragraph((String) TC15.getSelectedItem(), font100));
            PdfPCell cell16 = new PdfPCell(new Paragraph(TC17.getText(), font100));
            table.addCell(cell11);
            table.addCell(cell12);
            table.addCell(cell13);
            table.addCell(cell14);
            table.addCell(cell15);
            table.addCell(cell16);
            table.addCell("");
        } else {
            for (int i = 0; i < 7; i++)
                table.addCell(vacume);
        }

        float[] ColumnWidths = new float[] { 8f, 12f, 12f, 12f, 22f, 8f, 15f, 7f };
        table.setWidths(ColumnWidths);
        table.setWidthPercentage(106);
        table.setHorizontalAlignment(Element.ALIGN_LEFT);
        document.add(table);

        document.add(new Paragraph("                                       "));
        document.add(new Paragraph("                                       "));
        document.add(new Paragraph(
                "1. I certified that the entries as regard details of the student have been duly checked from the 'Admission form' and that they are complete.",
                FontFactory.getFont(FontFactory.TIMES_ROMAN, 10, Font.NORMAL, BaseColor.BLACK)));
        // document.add(new Paragraph("                                                                                                        "));

        document.add(new Paragraph("                                       "));
        document.add(new Paragraph(
                "2. Certified that the above Students register have been posted up-to date of students leaving as required by the departmental rules.",
                FontFactory.getFont(FontFactory.TIMES_ROMAN, 10, Font.NORMAL, BaseColor.BLACK)));
        document.add(new Paragraph("                                       "));
        document.add(new Paragraph("                                       "));
        document.add(new Paragraph(
                "Prepared by:-" + "                                " + "Date:-" + " "
                        + new java.util.Date().toString() + "                      " + "Principal's Sign:-",
                FontFactory.getFont(FontFactory.TIMES_BOLD, 12, Font.NORMAL, BaseColor.BLACK)));

        document.add(new Paragraph("                                       "));
        document.add(new Paragraph(
                "----------------------------------------------------------------------------------------------------------------------------------"));
        document.add(new Paragraph("An ISO 9001:2008 Certified School(Certificate Number:NOR/0712M/1505)",
                FontFactory.getFont(FontFactory.COURIER, 12, Font.NORMAL, BaseColor.BLUE)));
        document.add(new Paragraph("(Run By:Smart Educational Society)Regd.No.(DR/GGN/285)",
                FontFactory.getFont(FontFactory.COURIER, 12, Font.NORMAL, BaseColor.BLUE)));
        document.add(new Paragraph(
                "413A/23,Gali No:-2,Heera Nagar,Near Rajendra Hospital,Khandsa Road,Gurgaon(Haryana)",
                FontFactory.getFont(FontFactory.COURIER, 10, Font.NORMAL, BaseColor.BLUE)));
        cb.saveState();
        cb.setColorStroke(BaseColor.BLACK);
        cb.rectangle(2, 2, 588, 828);
        cb.stroke();
        cb.restoreState();
        JOptionPane.showMessageDialog(this, "it is saved");
        document.close();
    } catch (Exception ee) {
        JOptionPane.showMessageDialog(this, ee);
    } // TODO add your handling code here:
}

From source file:org.agmip.ui.afsirs.util.AFSIRSUtils.java

private void designTableTitleCell(PdfPTable table, String str) {
    PdfPCell cell;// ww w  . ja  va 2s  .  c o  m
    // we add a c with colspan 3
    cell = new PdfPCell(new Phrase(str, BLUE_NORMAL));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.setBackgroundColor(BaseColor.ORANGE);
    cell.setColspan(14);
    table.addCell(cell);
}

From source file:org.agmip.ui.afsirs.util.AFSIRSUtils.java

private void designRowTitleCell(PdfPTable table, String str) {
    PdfPCell cell;//from   ww w .ja  v a2  s  .co  m
    // we add a c with colspan 3
    cell = new PdfPCell(new Phrase(str, BLUE_NORMAL));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.setBackgroundColor(BaseColor.ORANGE);
    //cell.setColspan(14);
    table.addCell(cell);
}

From source file:org.agmip.ui.afsirs.util.AFSIRSUtils.java

private void designTableHeaderRowCell(PdfPTable table, String str) {
    PdfPCell cell;// www.j  ava 2  s  .  c  o m
    // we add a c with colspan 3
    cell = new PdfPCell(new Phrase(str, BLUE_NORMAL));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.setBackgroundColor(BaseColor.ORANGE);
    //cell.setColspan(14);
    table.addCell(cell);
}