Example usage for com.itextpdf.text.pdf GrayColor GRAYWHITE

List of usage examples for com.itextpdf.text.pdf GrayColor GRAYWHITE

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf GrayColor GRAYWHITE.

Prototype

GrayColor GRAYWHITE

To view the source code for com.itextpdf.text.pdf GrayColor GRAYWHITE.

Click Source Link

Usage

From source file:Capa_Modelo.Reportes.java

public void generarReporteInventario() {
    Connection con;//from  w  ww. j av a2 s  . c  o m
    ResultSet res;
    Statement sentencia;
    Document documento = new Document(PageSize.A4);
    con = ConexionDB.GetConnection();
    try {
        sentencia = con.createStatement();
        res = sentencia.executeQuery(
                "SELECT Cantidad, Cantidadmin,  Cantidadmax, Medicamento.Nombre, Medicamento.FechaElaboracion, Medicamento.Composicion, Medicamento.FechaVencimiento, Medicamento.Laboratorio FROM Inventario inner join Medicamento on Inventario.ID_Medicamento = Medicamento.ID_Medicamento ");
        PdfWriter.getInstance(documento, new FileOutputStream(
                "reportes/reporte_de_inventario " + fechaActual() + " " + horaActual() + ".pdf"));
        documento.open();
        float[] columnWidths = { 2, 2, 2, 2, 2, 2, 2, 2 };
        PdfPTable table = new PdfPTable(columnWidths);
        table.setWidthPercentage(100);
        table.getDefaultCell().setUseAscender(true);
        table.getDefaultCell().setUseDescender(true);
        Font f = new Font(Font.FontFamily.HELVETICA, 13, Font.NORMAL, GrayColor.GRAYWHITE);
        PdfPCell cell = new PdfPCell(new Phrase("Reporte de Medicamentos", f));
        cell.setBackgroundColor(GrayColor.GRAYBLACK);
        cell.setHorizontalAlignment(com.itextpdf.text.Element.ALIGN_CENTER);
        cell.setColspan(8);
        table.addCell(cell);
        table.getDefaultCell().setBackgroundColor(new GrayColor(0.75f));
        for (int i = 0; i < 2; i++) {
            table.addCell("Medicamento");
            table.addCell("Composicion");
            table.addCell("Laboratorio");
            table.addCell("Fecha de Elaboracion");
            table.addCell("Fecha de Vencimiento");
            table.addCell("Cantidad minima");
            table.addCell("Cantidad actual");
            table.addCell("Cantidad maxima");
        }
        table.setHeaderRows(3);
        table.setFooterRows(1);
        table.getDefaultCell().setBackgroundColor(GrayColor.GRAYWHITE);
        table.getDefaultCell().setHorizontalAlignment(com.itextpdf.text.Element.ALIGN_CENTER);
        while (res.next()) {
            table.addCell(res.getString("Nombre"));
            table.addCell(res.getString("Composicion"));
            table.addCell(res.getString("Laboratorio"));
            table.addCell(res.getString("FechaElaboracion"));
            table.addCell(res.getString("FechaVencimiento"));
            table.addCell(res.getString("Cantidadmin"));
            table.addCell(res.getString("Cantidad"));
            table.addCell(res.getString("Cantidadmax"));
        }
        documento.add(table);
        documento.close();
        JOptionPane.showMessageDialog(null, "Reporte de Inventario generado correctamente");
    } catch (SQLException ex) {
        JOptionPane.showMessageDialog(null, "Error al conectar con la base de datos");
    } catch (FileNotFoundException ex) {
        JOptionPane.showMessageDialog(null, "Error al generar la ruta del archivo");
    } catch (DocumentException ex) {
        JOptionPane.showMessageDialog(null, "Error al generar el archivo");
    }

}

From source file:Capa_Modelo.Reportes.java

public void generarReporteVencimiento() {
    Connection con;/* w  w w . j av a  2s  . com*/
    ResultSet res;
    Statement sentencia;
    Document documento = new Document(PageSize.A4);
    con = ConexionDB.GetConnection();
    try {
        sentencia = con.createStatement();
        res = sentencia.executeQuery(
                "SELECT Cantidad, Cantidadmin, Cantidadmax, Medicamento.Nombre, Medicamento.FechaElaboracion, Medicamento.FechaVencimiento, Medicamento.Laboratorio FROM Inventario inner join Medicamento on Inventario.ID_Medicamento = Medicamento.ID_Medicamento ");
        PdfWriter.getInstance(documento, new FileOutputStream(
                "reportes/reporte_de_vencimiento " + fechaActual() + " " + horaActual() + ".pdf"));
        documento.open();
        float[] columnWidths = { 2, 2, 2, 2 };
        PdfPTable table = new PdfPTable(columnWidths);
        table.setWidthPercentage(100);
        table.getDefaultCell().setUseAscender(true);
        table.getDefaultCell().setUseDescender(true);
        Font f = new Font(Font.FontFamily.HELVETICA, 13, Font.NORMAL, GrayColor.GRAYWHITE);
        PdfPCell cell = new PdfPCell(new Phrase("Reporte de Vencimiento", f));
        cell.setBackgroundColor(GrayColor.GRAYBLACK);
        cell.setHorizontalAlignment(com.itextpdf.text.Element.ALIGN_CENTER);
        cell.setColspan(4);
        table.addCell(cell);
        table.getDefaultCell().setBackgroundColor(new GrayColor(0.75f));
        for (int i = 0; i < 2; i++) {
            table.addCell("Medicamento");
            table.addCell("Laboratorio");
            table.addCell("Fecha de Vencimiento");
            table.addCell("Cantidad actual");
        }
        table.setHeaderRows(3);
        table.setFooterRows(1);
        table.getDefaultCell().setBackgroundColor(GrayColor.GRAYWHITE);
        table.getDefaultCell().setHorizontalAlignment(com.itextpdf.text.Element.ALIGN_CENTER);
        while (res.next()) {
            if (vencido(res.getDate("FechaVencimiento"))) {
                table.addCell(res.getString("Nombre"));
                table.addCell(res.getString("Laboratorio"));
                table.addCell(res.getString("FechaVencimiento"));
                table.addCell(res.getString("Cantidad"));
            }
        }
        documento.add(table);
        documento.close();
        JOptionPane.showMessageDialog(null, "Reporte de Vencimiento generado correctamente");
    } catch (SQLException ex) {
        JOptionPane.showMessageDialog(null, "Error en conectar con base de datos");
    } catch (DocumentException ex) {
        Logger.getLogger(Reportes.class.getName()).log(Level.SEVERE, null, "El documento no se pudo generar");
    } catch (FileNotFoundException ex) {
        Logger.getLogger(Reportes.class.getName()).log(Level.SEVERE, null, "EL archivo no se abri");
    }
}

From source file:Capa_Modelo.Reportes.java

public void generarReporteConsumoMedicamentos() {
    DecimalFormat df = new DecimalFormat("####0.00");
    Connection con;/*w w  w .j a v  a 2 s  .  c  o  m*/
    ResultSet res;
    Statement sentencia;
    Document documento = new Document(PageSize.A4);
    double consumo, cantidad;
    double porcentaje;
    consumo = cantidad = 0;
    con = ConexionDB.GetConnection();
    try {
        sentencia = con.createStatement();
        res = sentencia.executeQuery(
                "SELECT Medicamento.Nombre, Medicamento.Composicion, Medicamento.Laboratorio, Inventario.Cantidad, SUM(MedicinaPaciente.Cantidad) as Consumo FROM MedicinaPaciente INNER JOIN Medicamento ON MedicinaPaciente.ID_Medicamento = Medicamento.ID_Medicamento INNER JOIN Inventario ON MedicinaPaciente.ID_Medicamento = Inventario.ID_Medicamento  GROUP BY Medicamento.Nombre, Medicamento.Composicion , Medicamento.Laboratorio, Inventario.Cantidad ORDER BY Consumo");
        PdfWriter.getInstance(documento, new FileOutputStream(
                "reportes/reporte_de_consumo_medicamentos " + fechaActual() + " " + horaActual() + ".pdf"));
        documento.open();
        float[] columnWidths = { 2, 2, 2, 2, 2, 2 };
        PdfPTable table = new PdfPTable(columnWidths);
        table.setWidthPercentage(100);
        table.getDefaultCell().setUseAscender(true);
        table.getDefaultCell().setUseDescender(true);
        Font f = new Font(Font.FontFamily.HELVETICA, 13, Font.NORMAL, GrayColor.GRAYWHITE);
        PdfPCell cell = new PdfPCell(new Phrase("Reporte de Consumo Medicamentos", f));
        cell.setBackgroundColor(GrayColor.GRAYBLACK);
        cell.setHorizontalAlignment(com.itextpdf.text.Element.ALIGN_CENTER);
        cell.setColspan(8);
        table.addCell(cell);
        table.getDefaultCell().setBackgroundColor(new GrayColor(0.75f));
        for (int i = 0; i < 2; i++) {
            table.addCell("Medicamento");
            table.addCell("Composicion");
            table.addCell("Laboratorio");
            table.addCell("Cantidad");
            table.addCell("Unidades consumidas");
            table.addCell("Porcentaje de consumo");
        }
        table.setHeaderRows(3);
        table.setFooterRows(1);
        table.getDefaultCell().setBackgroundColor(GrayColor.GRAYWHITE);
        table.getDefaultCell().setHorizontalAlignment(com.itextpdf.text.Element.ALIGN_CENTER);
        while (res.next()) {
            consumo = res.getInt("Consumo");
            cantidad = res.getInt("Cantidad");
            porcentaje = consumo / cantidad * 100;
            System.out.println("consumo: " + consumo + " cantidad: " + cantidad + " porcentaje: " + porcentaje);
            table.addCell(res.getString("Nombre"));
            table.addCell(res.getString("Composicion"));
            table.addCell(res.getString("Laboratorio"));
            table.addCell(res.getString("Cantidad"));
            table.addCell(res.getString("Consumo"));
            table.addCell(((df.format(porcentaje))) + "%");

        }
        documento.add(table);
        documento.close();
        JOptionPane.showMessageDialog(null, "Reporte de Consumo de Medicamentos generado correctamente");
    } catch (SQLException ex) {
        JOptionPane.showMessageDialog(null, "Error al conectar con la base de datos");
    } catch (FileNotFoundException ex) {
        JOptionPane.showMessageDialog(null, "Error al generar la ruta del archivo");
    } catch (DocumentException ex) {
        JOptionPane.showMessageDialog(null, "Error al generar el archivo");
    }
}

From source file:Capa_Modelo.Reportes.java

public void generarReporteESMedicamentos() {
    Connection con;/*from www.  j av a 2 s .c  o  m*/
    ResultSet res, res2;
    Statement sentencia;
    Document documento = new Document(PageSize.A4);
    con = ConexionDB.GetConnection();
    try {
        sentencia = con.createStatement();
        res = sentencia.executeQuery(
                "SELECT Medicamento.Nombre, Medicamento.Composicion, Medicamento.Laboratorio, Medicamento.FechaLlegada, Inventario.Cantidad FROM Medicamento INNER JOIN Inventario ON Medicamento.ID_Medicamento = Inventario.ID_Medicamento ORDER BY Inventario.Cantidad, Medicamento.Nombre desc");
        PdfWriter.getInstance(documento, new FileOutputStream("reportes/reporte_de_entrada-salida_medicamentos "
                + fechaActual() + " " + horaActual() + ".pdf"));
        documento.open();
        float[] columnWidths = { 2, 2, 2, 2, 2 };
        PdfPTable table = new PdfPTable(columnWidths);
        table.setWidthPercentage(100);
        table.getDefaultCell().setUseAscender(true);
        table.getDefaultCell().setUseDescender(true);
        Font f = new Font(Font.FontFamily.HELVETICA, 13, Font.NORMAL, GrayColor.GRAYWHITE);
        PdfPCell cell = new PdfPCell(new Phrase("Reporte de Entrada de Medicamentos", f));
        cell.setBackgroundColor(GrayColor.GRAYBLACK);
        cell.setHorizontalAlignment(com.itextpdf.text.Element.ALIGN_CENTER);
        cell.setColspan(8);
        table.addCell(cell);
        table.getDefaultCell().setBackgroundColor(new GrayColor(0.75f));
        for (int i = 0; i < 2; i++) {
            table.addCell("Medicamento");
            table.addCell("Composicion");
            table.addCell("Laboratorio");
            table.addCell("Fecha de Entrada");
            table.addCell("Cantidad");
        }
        table.setHeaderRows(3);
        table.setFooterRows(1);
        table.getDefaultCell().setBackgroundColor(GrayColor.GRAYWHITE);
        table.getDefaultCell().setHorizontalAlignment(com.itextpdf.text.Element.ALIGN_CENTER);
        while (res.next()) {
            table.addCell(res.getString("Nombre"));
            table.addCell(res.getString("Composicion"));
            table.addCell(res.getString("Laboratorio"));
            table.addCell(res.getString("FechaLlegada"));
            table.addCell(res.getString("Cantidad"));
        }
        documento.add(table);
        documento.newPage();
        res2 = sentencia.executeQuery(
                "SELECT Medicamento.Nombre, Medicamento.Composicion, Medicamento.Laboratorio, MedicinaPaciente.FechaEntrega, SUM(MedicinaPaciente.Cantidad) AS Entregados FROM Medicamento INNER JOIN MedicinaPaciente ON Medicamento.ID_Medicamento = MedicinaPaciente.ID_Medicamento  group by Medicamento.Nombre, Medicamento.Composicion, Medicamento.Laboratorio,MedicinaPaciente.FechaEntrega ORDER BY Entregados");
        float[] columnWidths2 = { 2, 2, 2, 2, 2 };
        PdfPTable table2 = new PdfPTable(columnWidths);
        table2.setWidthPercentage(100);
        table2.getDefaultCell().setUseAscender(true);
        table2.getDefaultCell().setUseDescender(true);
        PdfPCell cell2 = new PdfPCell(new Phrase("Reporte de Salida de Medicamentos", f));
        cell2.setBackgroundColor(GrayColor.GRAYBLACK);
        cell2.setHorizontalAlignment(com.itextpdf.text.Element.ALIGN_CENTER);
        cell2.setColspan(8);
        table2.addCell(cell2);
        table2.getDefaultCell().setBackgroundColor(new GrayColor(0.75f));
        for (int i = 0; i < 2; i++) {
            table2.addCell("Medicamento");
            table2.addCell("Composicion");
            table2.addCell("Laboratorio");
            table2.addCell("Fecha de Salida");
            table2.addCell("Cantidad");
        }
        table2.setHeaderRows(3);
        table2.setFooterRows(1);
        table2.getDefaultCell().setBackgroundColor(GrayColor.GRAYWHITE);
        table2.getDefaultCell().setHorizontalAlignment(com.itextpdf.text.Element.ALIGN_CENTER);
        while (res2.next()) {
            table2.addCell(res2.getString("Nombre"));
            table2.addCell(res2.getString("Composicion"));
            table2.addCell(res2.getString("Laboratorio"));
            table2.addCell(res2.getString("FechaEntrega"));
            table2.addCell(res2.getString("Entregados"));
        }
        documento.add(table2);
        documento.close();
        JOptionPane.showMessageDialog(null,
                "Reporte de Entrada y Salida de Medicamentos generado correctamente");
    } catch (SQLException ex) {
        JOptionPane.showMessageDialog(null, "Error al conectar con la base de datos");
    } catch (FileNotFoundException ex) {
        JOptionPane.showMessageDialog(null, "Error al generar la ruta del archivo");
    } catch (DocumentException ex) {
        JOptionPane.showMessageDialog(null, "Error al generar el archivo");
    }
}

From source file:server.kartu.tik.iText.java

public String createPDF(String tanggal, ArrayList kegiatan, String divisi) {
    ArrayList<Kegiatan> list = new ArrayList<>(kegiatan);

    String output = System.getProperty("user.dir") + "\\src\\data\\pdf\\" + tanggal + " " + getNamalengkap()
            + "-" + getTglnoktp() + ".pdf";

    String namaDivisi = "";
    switch (divisi) {
    case "1":
        namaDivisi = "Ekonomi";
        break;//w w w.  j  a  v a  2s . c  o m
    case "2":
        namaDivisi = "Politik";
        break;
    case "3":
        namaDivisi = "Sosial Budaya";
        break;
    case "4":
        namaDivisi = "Keamanan";
        break;
    }

    Document document = new Document(PageSize.A4);
    try {
        PdfWriter.getInstance(document, new FileOutputStream(output));

        document.open();

        //------------------------------------------------------------------------------------- TITLE
        PdfPTable title = new PdfPTable(1);
        title.setWidthPercentage(100);
        Font f = new Font(FontFamily.HELVETICA, 14, Font.NORMAL, GrayColor.GRAYWHITE);
        PdfPCell celltitle = new PdfPCell(new Phrase("KARTU TIK (" + namaDivisi + ")", f));
        celltitle.setMinimumHeight(20);
        celltitle.setBackgroundColor(GrayColor.GRAYBLACK);
        celltitle.setHorizontalAlignment(Element.ALIGN_CENTER);
        celltitle.setColspan(3);
        title.addCell(celltitle);
        document.add(title);
        //-------------------------------------------------------------------------------------- END

        //------------------------------------------------------------------------------------- NAMA + ALIAS
        float[] columnWidths = { 8, 2 };
        PdfPTable tabel1 = new PdfPTable(columnWidths);
        tabel1.setWidthPercentage(100);

        PdfPTable innerTable1 = new PdfPTable(1);
        innerTable1.setWidthPercentage(100);
        PdfPTable innerTable2 = new PdfPTable(1);
        innerTable2.setWidthPercentage(100);
        PdfPCell cell;
        innerTable1.addCell(
                "1.  a. Nama Lengkap : " + getNamalengkap() + " \n\n     b. Alias : " + getAlias() + " \n\n");
        innerTable1.addCell("2.  Kebangsaan \n     a. Tgl. No. KTP : " + getTglnoktp()
                + " \n\n     b. Tgl. No. Pasport : " + getTglnopasport() + "\n\n");
        innerTable1.addCell("3.  Agama : " + getAgama());
        cell = new PdfPCell(innerTable1);
        cell.setMinimumHeight(135);
        tabel1.addCell(cell);
        if (getUrlfoto().equalsIgnoreCase("") || getUrlfoto().isEmpty() || getUrlfoto() == null) {

        } else {
            Image image = Image.getInstance(getUrlfoto());
            cell = new PdfPCell(image, false);
            if (image.getWidth() < 90) {
                cell.setPaddingLeft(8);
            } else {
                cell.setPaddingLeft(3);
            }
        }
        cell.setMinimumHeight(135);
        tabel1.addCell(cell);
        cell = new PdfPCell();
        cell.setColspan(14);
        tabel1.addCell(cell);

        document.add(tabel1);
        //------------------------------------------------------------------------------------- NAMA + ALIAS END

        //------------------------------------------------------------------------------------- TGL LAHIR + TEMPAT
        PdfPTable tabel4 = new PdfPTable(1);
        tabel4.setWidthPercentage(100);

        Paragraph pTglLahirnTempat = new Paragraph();
        pTglLahirnTempat.add("4.  a. Tgl. Lahir/ Umur : " + getTgllahir());
        pTglLahirnTempat.add("\n\n     b. Tempat Lahir     : " + getTempatlahir());
        pTglLahirnTempat.setLeading(0, 1);

        PdfPCell cTglLahirnTempat = new PdfPCell();
        cTglLahirnTempat.setMinimumHeight(45);
        cTglLahirnTempat.addElement(pTglLahirnTempat);
        tabel4.addCell(cTglLahirnTempat);

        document.add(tabel4);
        //------------------------------------------------------------------------------------- TGL LAHIR + TEMPAT END

        //------------------------------------------------------------------------------------- ALAMAT + PINDAHAN
        PdfPTable tabel5 = new PdfPTable(1);
        tabel5.setWidthPercentage(100);

        Paragraph pAlamat = new Paragraph();
        pAlamat.add("5.  Alamat : ");
        pAlamat.add(alamat);
        pAlamat.setLeading(0, 1);

        PdfPCell cAlamat = new PdfPCell();
        cAlamat.setMinimumHeight(18);
        cAlamat.addElement(pAlamat);
        tabel5.addCell(cAlamat);
        document.add(tabel5);

        PdfPTable tabel51 = new PdfPTable(1);
        tabel51.setWidthPercentage(100);

        Paragraph pAlamatUbah = new Paragraph();
        pAlamatUbah.add("6.  Perubahan Alamat :");
        pAlamatUbah.add("\n\n    1. ");
        pAlamatUbah.add("\n\n    2. ");
        pAlamatUbah.add("\n\n    3. ");
        pAlamatUbah.add("\n\n");
        pAlamatUbah.setLeading(0, 1);

        PdfPCell cAlamatUbah = new PdfPCell();
        cAlamatUbah.addElement(pAlamatUbah);
        tabel51.addCell(cAlamatUbah);
        document.add(tabel51);
        //------------------------------------------------------------------------------------- ALAMAT + PINDAHAN END

        //------------------------------------------------------------------------------------- KEDUDUKAN KELUARGA
        PdfPTable tabel6 = new PdfPTable(1);
        tabel6.setWidthPercentage(100);

        Paragraph pKedudukanKeluarga = new Paragraph();
        pKedudukanKeluarga.add("7.  Kedudukan dalam Keluarga : ");
        pKedudukanKeluarga.setLeading(0, 1);

        PdfPCell cKedudukanKeluarga = new PdfPCell();
        cKedudukanKeluarga.setMinimumHeight(20);
        cKedudukanKeluarga.addElement(pKedudukanKeluarga);
        tabel6.addCell(cKedudukanKeluarga);
        document.add(tabel6);

        PdfPTable tabel61 = new PdfPTable(1);
        tabel61.setWidthPercentage(100);

        Paragraph pNamaBapakIbu = new Paragraph();
        pNamaBapakIbu.add("8.  a.  Nama Bapak : ");
        pNamaBapakIbu.add("\n\n          Nama Ibu      : ");
        pNamaBapakIbu.add("\n\n     b.  Alamat : ");
        pNamaBapakIbu.setLeading(0, 1);

        PdfPCell cNamaBapakIbu = new PdfPCell();
        cNamaBapakIbu.setMinimumHeight(70);
        cNamaBapakIbu.addElement(pNamaBapakIbu);
        tabel61.addCell(cNamaBapakIbu);

        document.add(tabel61);
        //------------------------------------------------------------------------------------- KEDUDUKAN END

        //------------------------------------------------------------------------------------- PEKERJAAN
        PdfPTable tabel7 = new PdfPTable(2);
        tabel7.setWidthPercentage(100);

        Paragraph pPekerjaan = new Paragraph();
        pPekerjaan.add("9.  a. Pekerjaan : " + getPekerjaan());
        pPekerjaan.setLeading(0, 1);

        PdfPCell cPekerjaan = new PdfPCell();
        cPekerjaan.setMinimumHeight(20);
        cPekerjaan.addElement(pPekerjaan);
        tabel7.addCell(cPekerjaan);

        Paragraph pJabatan = new Paragraph();
        pJabatan.add("  b. Jabatan : " + getJabatan());
        pJabatan.setLeading(0, 1);

        PdfPCell cJabatan = new PdfPCell();
        cJabatan.setMinimumHeight(20);
        cJabatan.addElement(pJabatan);
        tabel7.addCell(cJabatan);

        document.add(tabel7);
        //------------------------------------------------------------------------------------- PEKERJAAN END

        //------------------------------------------------------------------------------------- INSTANSI DLL
        PdfPTable tabel8 = new PdfPTable(1);
        tabel8.setWidthPercentage(100);

        Paragraph pInstansi = new Paragraph();
        pInstansi.add("     c. Instansi/Lembaga/Kantor : " + getInstansilembagakantor());
        pInstansi.setLeading(0, 1);

        PdfPCell cInstansi = new PdfPCell();
        cInstansi.setMinimumHeight(20);
        cInstansi.addElement(pInstansi);
        tabel8.addCell(cInstansi);

        document.add(tabel8);
        //------------------------------------------------------------------------------------- INSTANSI DLL END

        //------------------------------------------------------------------------------------- NAMA ISTRI
        float[] colomn = { 7, 1, 2 };
        PdfPTable tabel9 = new PdfPTable(colomn);
        tabel9.setWidthPercentage(100);

        Paragraph pNamaIstriBapakIbu = new Paragraph();
        pNamaIstriBapakIbu.add("10.");
        pNamaIstriBapakIbu.add("\n       a. Nama Istri : ");
        pNamaIstriBapakIbu.add("\n\n       b. Nama Bapak Istri : ");
        pNamaIstriBapakIbu.add("\n\n       c. Nama Ibu Istri : ");
        pNamaIstriBapakIbu.add("\n\n       d. Alamat : ");
        pNamaIstriBapakIbu.setLeading(0, 1);

        PdfPCell cNamaIstriBapakIbu = new PdfPCell();
        cNamaIstriBapakIbu.setMinimumHeight(110);
        cNamaIstriBapakIbu.addElement(pNamaIstriBapakIbu);
        tabel9.addCell(cNamaIstriBapakIbu);

        Paragraph pUmurIstriBapakIbu = new Paragraph();
        pUmurIstriBapakIbu.add("  Umur :");
        pUmurIstriBapakIbu.setLeading(0, 1);

        PdfPCell cUmurIstriBapakIbu = new PdfPCell();
        cUmurIstriBapakIbu.setMinimumHeight(110);
        cUmurIstriBapakIbu.addElement(pUmurIstriBapakIbu);
        tabel9.addCell(cUmurIstriBapakIbu);

        Paragraph pPekerjaanIstriBapakIbu = new Paragraph();
        pPekerjaanIstriBapakIbu.add("  Pekerjaan :");
        pPekerjaanIstriBapakIbu.setLeading(0, 1);

        PdfPCell cPekerjaanIstriBapakIbu = new PdfPCell();
        cPekerjaanIstriBapakIbu.setMinimumHeight(110);
        cPekerjaanIstriBapakIbu.addElement(pPekerjaanIstriBapakIbu);
        tabel9.addCell(cPekerjaanIstriBapakIbu);

        document.add(tabel9);
        //------------------------------------------------------------------------------------- NAMA ISTRI END

        //------------------------------------------------------------------------------------- SANAK SAUDARA
        PdfPTable tabel10 = new PdfPTable(colomn);
        tabel10.setWidthPercentage(100);

        Paragraph pSanakSaudara = new Paragraph();
        pSanakSaudara.add("11.  Nama Sanak/Saudara yang menjadi Tanggungan : \n       1.\n       2.");
        pSanakSaudara.setLeading(0, 1);

        PdfPCell cSanakSaudara = new PdfPCell();
        cSanakSaudara.addElement(pSanakSaudara);
        tabel10.addCell(cSanakSaudara);

        Paragraph pSanakSaudara1 = new Paragraph();
        pSanakSaudara1.add("");
        pSanakSaudara1.setLeading(0, 1);

        PdfPCell cSanakSaudara1 = new PdfPCell();
        cSanakSaudara1.addElement(pSanakSaudara1);
        tabel10.addCell(cSanakSaudara1);

        Paragraph pSanakSaudara2 = new Paragraph();
        pSanakSaudara2.add("");
        pSanakSaudara2.setLeading(0, 1);

        PdfPCell cSanakSaudara2 = new PdfPCell();
        cSanakSaudara2.addElement(pSanakSaudara2);
        tabel10.addCell(cSanakSaudara2);

        document.add(tabel10);
        //------------------------------------------------------------------------------------- SANAK SAUDARA END

        //------------------------------------------------------------------------------------- ANAK2
        PdfPTable tabel11 = new PdfPTable(colomn);
        tabel11.setWidthPercentage(100);

        Paragraph pAnak2 = new Paragraph();
        pAnak2.add("12.  Anak-anak : ");
        pAnak2.add("\n\n       1. ");
        pAnak2.add("\n\n       2. ");
        pAnak2.add("\n\n       3. ");
        pAnak2.add("\n\n       4. ");
        pAnak2.add("\n\n       5. ");
        pAnak2.add("\n\n       6. ");
        pAnak2.add("\n");
        pAnak2.setLeading(0, 1);

        PdfPCell cAnak2 = new PdfPCell();
        cAnak2.setMinimumHeight(165);
        cAnak2.addElement(pAnak2);
        tabel11.addCell(cAnak2);

        Paragraph pUmurAnak2 = new Paragraph();
        pUmurAnak2.add("  Umur : ");
        pUmurAnak2.setLeading(0, 1);

        PdfPCell cUmurAnak2 = new PdfPCell();
        cUmurAnak2.setMinimumHeight(165);
        cUmurAnak2.addElement(pUmurAnak2);
        tabel11.addCell(cUmurAnak2);

        Paragraph pPekarjaanAnak2 = new Paragraph();
        pPekarjaanAnak2.add("  Pekerjaan : ");
        pPekarjaanAnak2.setLeading(0, 1);

        PdfPCell cPekerjaanAnak2 = new PdfPCell();
        cPekerjaanAnak2.setMinimumHeight(165);
        cPekerjaanAnak2.addElement(pPekarjaanAnak2);
        tabel11.addCell(cPekerjaanAnak2);

        document.add(tabel11);
        //------------------------------------------------------------------------------------- ANAK2 END

        //------------------------------------------------------------------------------------- CIRI-CIRI
        PdfPTable tabel12 = new PdfPTable(1);
        tabel12.setWidthPercentage(100);

        Paragraph pCiri2 = new Paragraph();
        pCiri2.add("13.  Ciri-ciri badan : ");
        pCiri2.add("\n\n       1. Rambut : " + getRambut());
        for (int i = 0; i < (35 - getRambut().length()); i++) {
            pCiri2.add(" ");
        }
        pCiri2.add("2. Muka : " + getMuka());
        for (int i = 0; i < (35 - getMuka().length()); i++) {
            pCiri2.add(" ");
        }
        pCiri2.add("3. Kulit : " + getKulit());
        pCiri2.setLeading(0, 1);

        PdfPCell cCiri2 = new PdfPCell();
        cCiri2.setMinimumHeight(45);
        cCiri2.addElement(pCiri2);
        tabel12.addCell(cCiri2);

        document.add(tabel12);
        //------------------------------------------------------------------------------------- CIRI-CIRI END

        //------------------------------------------------------------------------------------- LANJUTAN CIRI2
        PdfPTable tabel13 = new PdfPTable(1);
        tabel13.setWidthPercentage(100);

        Paragraph pCiri2Lanjutan = new Paragraph();
        for (int i = 0; i < 20; i++) {
            pCiri2Lanjutan.add(" ");
        }
        pCiri2Lanjutan.add("4.  Tinggi : " + getTinggi());
        for (int i = 0; i < (35 - getTinggi().length()); i++) {
            pCiri2Lanjutan.add(" ");
        }
        pCiri2Lanjutan.add("5.  Tanda Istimewa : " + getTandaistimewa());
        pCiri2Lanjutan.setLeading(0, 1);

        PdfPCell cCiri2Lanjutan = new PdfPCell();
        cCiri2Lanjutan.setMinimumHeight(20);
        cCiri2Lanjutan.addElement(pCiri2Lanjutan);
        tabel13.addCell(cCiri2Lanjutan);

        document.add(tabel13);
        //------------------------------------------------------------------------------------- LANJUTAN CIRI2

        //------------------------------------------------------------------------------------- RUMUS SIDIK JARI
        PdfPTable tabel14 = new PdfPTable(1);
        tabel14.setWidthPercentage(100);

        Paragraph pSidikJari = new Paragraph();
        pSidikJari.add("14.  Rumus Sidik Jari : " + getRumussidikjari());
        pSidikJari.setLeading(0, 1);

        PdfPCell cSidikJari = new PdfPCell();
        cSidikJari.setMinimumHeight(20);
        cSidikJari.addElement(pSidikJari);
        tabel14.addCell(cSidikJari);

        document.add(tabel14);
        //------------------------------------------------------------------------------------- RUMUS SIDIK JARI END

        //------------------------------------------------------------------------------------- RIWAYAT SEKOLAH
        float[] colom = { 8, 2 };
        PdfPTable tabel15 = new PdfPTable(colom);
        tabel15.setWidthPercentage(100);

        Paragraph pRiwayatSekolah = new Paragraph();
        pRiwayatSekolah.add("15.  Riwayat Sekolah : ");
        pRiwayatSekolah.add("\n\n       1. ");
        pRiwayatSekolah.add("\n\n       2. ");
        pRiwayatSekolah.add("\n\n       3. ");
        pRiwayatSekolah.add("\n\n       4. ");
        pRiwayatSekolah.add("\n\n       5. ");
        pRiwayatSekolah.add("\n\n       6. ");
        pRiwayatSekolah.setLeading(0, 1);

        PdfPCell cRiwayatSekolah = new PdfPCell();
        cRiwayatSekolah.setMinimumHeight(165);
        cRiwayatSekolah.addElement(pRiwayatSekolah);
        tabel15.addCell(cRiwayatSekolah);

        Paragraph pTahunLulus = new Paragraph();
        pTahunLulus.add("Tahun Lulus");
        pTahunLulus.setLeading(0, 1);

        PdfPCell cTahunLulus = new PdfPCell();
        cTahunLulus.setMinimumHeight(165);
        cTahunLulus.addElement(pTahunLulus);
        tabel15.addCell(cTahunLulus);

        document.add(tabel15);
        //------------------------------------------------------------------------------------- RIWAYAT SEKOLAH END

        //------------------------------------------------------------------------------------- KESENANGAN/KEGEMARAN/HOBI
        PdfPTable tabel16 = new PdfPTable(1);
        tabel16.setWidthPercentage(100);

        Paragraph pKesenenanganKegemaranHobi = new Paragraph();
        pKesenenanganKegemaranHobi.add("16.  Kesenangan/Kegemaran/Hobi : " + getHobi());
        pKesenenanganKegemaranHobi.setLeading(0, 1);

        PdfPCell cKesenenanganKegemaranHobi = new PdfPCell();
        cKesenenanganKegemaranHobi.setMinimumHeight(20);
        cKesenenanganKegemaranHobi.addElement(pKesenenanganKegemaranHobi);
        tabel16.addCell(cKesenenanganKegemaranHobi);

        document.add(tabel16);
        //------------------------------------------------------------------------------------- KESENANGAN/KEGEMARAN/HOBI END

        //------------------------------------------------------------------------------------- CATATAN KRIMINAL
        PdfPTable tabel17 = new PdfPTable(1);
        tabel17.setWidthPercentage(100);

        Paragraph pCatatanKriminal = new Paragraph();
        pCatatanKriminal.add("17.  Catatan kriminal yang ada : ");
        pCatatanKriminal.add("\n\n       1. " + getCatatankriminal1());
        pCatatanKriminal.add("\n\n       2. " + getCatatankriminal2());
        pCatatanKriminal.add("\n\n       3. " + getCatatankriminal3());
        pCatatanKriminal.setLeading(0, 1);

        PdfPCell cCatatanKriminal = new PdfPCell();
        cCatatanKriminal.setMinimumHeight(95);
        cCatatanKriminal.addElement(pCatatanKriminal);
        tabel17.addCell(cCatatanKriminal);

        document.add(tabel17);
        //------------------------------------------------------------------------------------- CATATAN KRIMINAL END

        //------------------------------------------------------------------------------------- KETERANGAN DLL
        PdfPTable tabel18 = new PdfPTable(1);
        tabel18.setWidthPercentage(100);

        Paragraph pDataKeteranganLain2 = new Paragraph();
        pDataKeteranganLain2.add("18.  Data Keterangan dan lain2 : ");
        pDataKeteranganLain2.add("\n\n\n");
        pDataKeteranganLain2.setLeading(0, 1);

        PdfPCell cDataKeteranganLain2 = new PdfPCell();
        cDataKeteranganLain2.addElement(pDataKeteranganLain2);

        if (list.size() > 0) {
            float[] kolomkegiatan = { 8, 2 };
            PdfPTable nestedTable = new PdfPTable(kolomkegiatan);

            nestedTable.addCell(new Paragraph("Kegiatan"));
            nestedTable.addCell(new Paragraph("Tanggal"));

            for (int i = 0; i < list.size(); i++) {
                nestedTable.addCell(new Paragraph(list.get(i).getNamakegiatan()));
                nestedTable.addCell(new Paragraph(list.get(i).getTanggal()));
            }

            cDataKeteranganLain2.addElement(nestedTable);
            cDataKeteranganLain2.setPaddingBottom(20f);
            tabel18.addCell(cDataKeteranganLain2);
        }

        document.add(tabel18);
        //------------------------------------------------------------------------------------- KETERANGAN DLL END

        document.close();

    } catch (DocumentException e) {
        e.printStackTrace();
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } catch (Exception e) {
        e.printStackTrace();
    }
    return output;
}