Example usage for com.lowagie.text.pdf PdfPCell setHorizontalAlignment

List of usage examples for com.lowagie.text.pdf PdfPCell setHorizontalAlignment

Introduction

In this page you can find the example usage for com.lowagie.text.pdf PdfPCell setHorizontalAlignment.

Prototype

public void setHorizontalAlignment(int horizontalAlignment) 

Source Link

Document

Sets the horizontal alignment for the cell.

Usage

From source file:s2s.report.MyPageEvents.java

License:GNU General Public License

@Override
public void onStartPage(PdfWriter writer, Document m_document) {
    if (!bShowHeader) {
        return;//from   w w  w.j  a v  a 2s . c o m
    }
    int pageN = writer.getPageNumber();
    if (!m_writeIndex) {
        if (!IndexAlreadyWrited) {
            pageN += m_iCount;
        }
    } else {
        pageN = ++m_iCurrentIndexPage;
    }

    PdfPTable tbl = new PdfPTable(3);

    String text = "                 " + ApplicationConfigurator.LanguageManager.getString("Pag") + " " + pageN
            + " " + ApplicationConfigurator.LanguageManager.getString("Di") + " ";

    tbl.setTotalWidth(m_rect.getWidth() - 60);
    tbl.addCell(new Phrase(strTopLeft, REPORT_SETTINGS.ftText10));

    PdfPCell pc = new PdfPCell(new Phrase(strTopCenter, REPORT_SETTINGS.ftText11));
    pc.setHorizontalAlignment(Element.ALIGN_CENTER);
    tbl.addCell(pc);

    Phrase ph = new Phrase(text, REPORT_SETTINGS.ftText10);
    tbl.addCell(ph);
    tbl.writeSelectedRows(0, -1, 30, m_rect.getHeight() - 30, cb);

    cb.addTemplate(template, bRotate ? 647 : 500, m_rect.getHeight() - 30 - 12);
}

From source file:s2s.report.MyPageEvents.java

License:GNU General Public License

@Override
public void onEndPage(PdfWriter writer, Document m_document) {
    if ((strBottomLeft.length() == 0) && (strBottomRight.length() == 0) && (bShowDate == false)
            && strFirstBottomLeft.length() == 0 && strFirstBottomRight.length() == 0) {
        return;//  w w  w .ja va 2  s .co m
    }
    int iColumns = 0;
    PdfPTable tbl1 = null;
    PdfPTable tbl2 = null;

    // Stampa gli eventuali valori delle celle (sinistra e destra) di un 
    // ulteriore pi di pagina, precedente a quello standard, senza bordi di 
    // tabella.
    if (strFirstBottomLeft.length() != 0 || strFirstBottomRight.length() != 0) {
        if (strFirstBottomLeft.length() != 0) {
            iColumns++;
        }
        if (strFirstBottomRight.length() != 0) {
            iColumns++;
        }
        tbl1 = new PdfPTable(iColumns);
        tbl1.setTotalWidth(m_rect.getWidth() - 60);
        if (strFirstBottomLeft.length() != 0) {
            PdfPCell cell = new PdfPCell(new Phrase(strFirstBottomLeft, REPORT_SETTINGS.ftText10));
            cell.setBorder(Rectangle.NO_BORDER);
            cell.setHorizontalAlignment(Element.ALIGN_LEFT);
            tbl1.addCell(cell);
        }
        if (strFirstBottomRight.length() != 0) {
            PdfPCell cell = new PdfPCell(new Phrase(strFirstBottomRight, REPORT_SETTINGS.ftText10));
            cell.setBorder(Rectangle.NO_BORDER);
            cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
            tbl1.addCell(cell);
        }
    }

    // Stampa gli eventuali valori delle celle (sinistra e destra) 
    // del pi di pagina standard.
    if ((strBottomLeft.length() != 0) || (strBottomRight.length() != 0) || (bShowDate == true)) {
        iColumns = 0;
        if (strBottomLeft.length() != 0) {
            iColumns++;
        }
        if (strBottomRight.length() != 0) {
            iColumns++;
        }
        if (bShowDate) {
            iColumns++;
        }

        tbl2 = new PdfPTable(iColumns);
        tbl2.setTotalWidth(m_rect.getWidth() - 60);
        if (strBottomLeft.length() != 0) {
            tbl2.addCell(new Phrase(strBottomLeft, REPORT_SETTINGS.ftText10));
        }
        if (strBottomRight.length() != 0) {
            tbl2.addCell(new Phrase(strBottomRight, REPORT_SETTINGS.ftText10));
        }
        if (bShowDate) {
            PdfPCell pc = new PdfPCell(new Phrase(
                    Formatter.format(new java.sql.Date(System.currentTimeMillis())), REPORT_SETTINGS.ftText11));
            pc.setHorizontalAlignment(Element.ALIGN_CENTER);
            tbl2.addCell(pc);
        }
    }

    // Scrive il pi di pagina precedente a quello standard
    if (tbl1 != null) {
        tbl1.writeSelectedRows(0, -1, 30, (tbl2 != null ? 150 : 100), cb);
    }
    // Scrive il pi di pagina standard
    if (tbl2 != null) {
        tbl2.writeSelectedRows(0, -1, 30, 50, cb);
    }
}

From source file:subcentro_licto.presentacion.beans.DatosBuscadorBean.java

public void imprimirDatos() {
    //DateFormat dfDateFull = DateFormat.getDateInstance(DateFormat.FULL);
    try {// w ww. ja va2s. c o m

        //Generamos el archivo PDF
        String directorioArchivos;
        ServletContext ctx = (ServletContext) FacesContext.getCurrentInstance().getExternalContext()
                .getContext();
        directorioArchivos = ctx.getRealPath("/") + "reports";
        String name = directorioArchivos + "/documento-datos.pdf";
        Document document = new Document();
        PdfWriter.getInstance(document, new FileOutputStream(name));

        //PdfWriter writer = PdfWriter.getInstance(document,
        //new FileOutputStream("C:"));
        Paragraph paragraph = new Paragraph();

        PdfPTable table = new PdfPTable(2);
        PdfPTable table1 = new PdfPTable(2);
        PdfPTable table2 = new PdfPTable(2);
        PdfPTable table3 = new PdfPTable(2);
        PdfPTable table4 = new PdfPTable(2);
        PdfPTable table5 = new PdfPTable(2);
        PdfPTable table6 = new PdfPTable(2);
        PdfPTable table7 = new PdfPTable(2);
        PdfPTable table8 = new PdfPTable(2);
        PdfPTable table9 = new PdfPTable(2);
        PdfPTable table10 = new PdfPTable(2);
        PdfPTable table11 = new PdfPTable(2);
        PdfPTable table12 = new PdfPTable(2);
        PdfPTable table13 = new PdfPTable(1);

        paragraph.add("\n\n\n\n\n\n");
        paragraph.setAlignment(Paragraph.ALIGN_CENTER);

        document.open();
        Image image1 = Image.getInstance(
                "C:/Users/Usuario/Documents/NetBeansProjects/gestionsalud/web/resources/images/logoMSP.jpg");

        image1.setAlignment(Element.ALIGN_CENTER);

        PdfPCell cell5 = new PdfPCell(new Paragraph("Fecha Agresin: " + datosSel.getFecha_agresion()));
        PdfPCell cell7 = new PdfPCell(new Paragraph("Fecha Atencin: " + datosSel.getFecha_de_atencion()));
        PdfPCell cell8 = new PdfPCell(new Paragraph("Nombres: " + datosSel.getNombres()));
        PdfPCell cell11 = new PdfPCell(new Paragraph("Apellidos: " + datosSel.getApellidos()));
        PdfPCell cell12 = new PdfPCell(new Paragraph("Edad: " + datosSel.getEdad()));
        PdfPCell cell9 = new PdfPCell(new Paragraph("Sexo: " + datosSel.getSexo()));
        PdfPCell cell10 = new PdfPCell(new Paragraph("Estado Civil:" + datosSel.getEstado_civil()));
        PdfPCell cell13 = new PdfPCell(new Paragraph("Instruccin:" + datosSel.getInstruccion_formal()));
        PdfPCell cell1 = new PdfPCell(new Paragraph("Ocupacin: " + datosSel.getOcupacion()));
        PdfPCell cell2 = new PdfPCell(new Paragraph("Institucin: " + datosSel.getInstitucion()));
        PdfPCell cell3 = new PdfPCell(new Paragraph("Asociacin: " + datosSel.getAsociacion()));
        PdfPCell cell4 = new PdfPCell(new Paragraph("Provincia: " + datosSel.getProvincia()));
        PdfPCell cell6 = new PdfPCell(new Paragraph("Cantn: " + datosSel.getCanton_domicilio()));
        PdfPCell cell14 = new PdfPCell(new Paragraph("Parroquia: " + datosSel.getParroquia_domicilio()));
        PdfPCell cell15 = new PdfPCell(new Paragraph("Barrio: " + datosSel.getBarrio()));
        PdfPCell cell16 = new PdfPCell(new Paragraph("Calles: " + datosSel.getCalles_domicilio()));
        PdfPCell cell17 = new PdfPCell(new Paragraph("Direccin Trabajo: " + datosSel.getDireccion_trabajo()));
        PdfPCell cell18 = new PdfPCell(new Paragraph("Telfono Domicilio: " + datosSel.getTelefono()));
        PdfPCell cell19 = new PdfPCell(new Paragraph("Telfono Trabajo: " + datosSel.getTelefono_trabajo()));
        PdfPCell cell20 = new PdfPCell(
                new Paragraph("Objeto de Agresin: " + datosSel.getObjeto_de_agresion()));
        PdfPCell cell21 = new PdfPCell(
                new Paragraph("Tipo de Agresin: " + datosSel.getTipos_de_agresiones()));
        PdfPCell cell22 = new PdfPCell(
                new Paragraph("Estado de Conciencia: " + datosSel.getEstado_de_conciencia()));
        PdfPCell cell23 = new PdfPCell(new Paragraph("Lugar de Agresin: " + datosSel.getLugar_de_agresion()));
        PdfPCell cell24 = new PdfPCell(new Paragraph("Frecuencia: " + datosSel.getFrecuencia()));
        PdfPCell cell25 = new PdfPCell(new Paragraph("Caso Medico: " + datosSel.getCaso_medico()));
        PdfPCell cell26 = new PdfPCell(new Paragraph("Tratamiento: " + datosSel.getTratamiento()));
        PdfPCell cell27 = new PdfPCell(new Paragraph("Referido: " + datosSel.getReferido()));

        cell1.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell2.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell3.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell4.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell5.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell6.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell7.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell8.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell9.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell10.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell11.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell12.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell13.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell14.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell15.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell16.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell17.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell18.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell19.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell20.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell21.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell22.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell23.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell24.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell25.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell26.setHorizontalAlignment(Element.ALIGN_LEFT);
        cell27.setHorizontalAlignment(Element.ALIGN_LEFT);

        cell1.setBorder(Rectangle.NO_BORDER);
        cell2.setBorder(Rectangle.NO_BORDER);
        cell3.setBorder(Rectangle.NO_BORDER);
        cell4.setBorder(Rectangle.NO_BORDER);
        cell5.setBorder(Rectangle.NO_BORDER);
        cell6.setBorder(Rectangle.NO_BORDER);
        cell7.setBorder(Rectangle.NO_BORDER);
        cell8.setBorder(Rectangle.NO_BORDER);
        cell9.setBorder(Rectangle.NO_BORDER);
        cell10.setBorder(Rectangle.NO_BORDER);
        cell11.setBorder(Rectangle.NO_BORDER);
        cell12.setBorder(Rectangle.NO_BORDER);
        cell13.setBorder(Rectangle.NO_BORDER);
        cell14.setBorder(Rectangle.NO_BORDER);
        cell15.setBorder(Rectangle.NO_BORDER);
        cell16.setBorder(Rectangle.NO_BORDER);
        cell17.setBorder(Rectangle.NO_BORDER);
        cell18.setBorder(Rectangle.NO_BORDER);
        cell19.setBorder(Rectangle.NO_BORDER);
        cell20.setBorder(Rectangle.NO_BORDER);
        cell21.setBorder(Rectangle.NO_BORDER);
        cell22.setBorder(Rectangle.NO_BORDER);
        cell23.setBorder(Rectangle.NO_BORDER);
        cell24.setBorder(Rectangle.NO_BORDER);
        cell25.setBorder(Rectangle.NO_BORDER);
        cell26.setBorder(Rectangle.NO_BORDER);
        cell27.setBorder(Rectangle.NO_BORDER);

        table1.addCell(cell5);
        table1.addCell(cell7);
        table2.addCell(cell8);
        table2.addCell(cell11);
        table3.addCell(cell12);
        table3.addCell(cell9);
        table.addCell(cell10);
        table.addCell(cell13);
        table4.addCell(cell1);
        table4.addCell(cell2);
        table5.addCell(cell3);
        table5.addCell(cell4);
        table6.addCell(cell6);
        table6.addCell(cell14);
        table7.addCell(cell15);
        table7.addCell(cell16);
        table8.addCell(cell17);
        table8.addCell(cell18);
        table9.addCell(cell19);
        table9.addCell(cell20);
        table10.addCell(cell21);
        table10.addCell(cell22);
        table11.addCell(cell23);
        table11.addCell(cell24);
        table12.addCell(cell25);
        table12.addCell(cell26);
        table13.addCell(cell27);

        document.add(image1);
        document.add(paragraph);
        document.add(table1);
        document.add(table2);
        document.add(table3);
        document.add(table);
        document.add(table4);
        document.add(table5);
        document.add(table6);
        document.add(table7);
        document.add(table8);
        document.add(table9);
        document.add(table10);
        document.add(table11);
        document.add(table12);
        document.add(table13);
        //document.add(table);
        //document.setFooter(event);

        document.close();
        //----------------------------
        //Abrimos el archivo PDF
        FacesContext context = FacesContext.getCurrentInstance();
        HttpServletResponse response = (HttpServletResponse) context.getExternalContext().getResponse();
        response.setContentType("application/pdf");
        response.setHeader("Content-disposition", "inline=filename=" + name);
        try {
            response.getOutputStream().write(Util.getBytesFromFile(new File(name)));
            response.getOutputStream().flush();
            response.getOutputStream().close();
            context.responseComplete();

        } catch (IOException e) {
            e.printStackTrace();
        }

    } catch (Exception e) {
        e.printStackTrace();
    }

}

From source file:test.itext.html.AimsPdf.java

License:Open Source License

public static void addTitle(Document doc, String text)
        throws IOException, BadElementException, DocumentException {
    float[] widths = { 62f, 164f, 62f };
    PdfPTable table = new PdfPTable(widths);
    table.setWidthPercentage(100);/*from  w  w  w .ja  v  a2 s.  c o m*/
    table.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.setSpacingAfter(10);

    Image image = Image.getInstance("app_title.gif");
    image.scalePercent(70);
    PdfPCell cell = new PdfPCell(image);
    cell.setPadding(10);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
    table.addCell(cell);

    Paragraph title = new Paragraph(text, FontFactory.getFont("arial", 12, Font.BOLD));
    cell = new PdfPCell(title);
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);

    image = Image.getInstance("title_shot.gif");
    image.scalePercent(70);
    cell = new PdfPCell(image);
    cell.setPadding(10);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
    table.addCell(cell);

    doc.add(table);

    table = new PdfPTable(1);
    table.setWidthPercentage(100);
    cell = new PdfPCell();
    cell.setBackgroundColor(Color.BLACK);
    cell.setFixedHeight(1);
    table.addCell(cell);

    doc.add(table);
}

From source file:test.itext.html.AimsPdf.java

License:Open Source License

public static void addScreenShorts(Document doc, String text)
        throws BadElementException, IOException, DocumentException {

    Paragraph heading = new Paragraph("Screenshots",
            FontFactory.getFont("arial", 10, Font.UNDERLINE | Font.BOLDITALIC));
    heading.setSpacingAfter(12f);//w ww  .ja v a 2s.  c o  m
    doc.add(heading);

    PdfPTable table = new PdfPTable(3);
    table.setWidthPercentage(80);
    table.setHorizontalAlignment(Element.ALIGN_CENTER);

    Image image = Image.getInstance("screen_shoot1.gif");
    image.scalePercent(70);
    PdfPCell cell = new PdfPCell(image);
    cell.setPadding(1);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
    table.addCell(cell);

    image = Image.getInstance("screen_shoot2.gif");
    image.scalePercent(70);
    cell = new PdfPCell(image);
    cell.setPadding(1);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
    table.addCell(cell);

    image = Image.getInstance("screen_shoot3.gif");
    image.scalePercent(70);
    cell = new PdfPCell(image);
    cell.setPadding(1);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
    table.addCell(cell);

    image = Image.getInstance("screen_shoot4.gif");
    image.scalePercent(70);
    cell = new PdfPCell(image);
    cell.setPadding(1);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
    table.addCell(cell);

    image = Image.getInstance("screen_shoot5.gif");
    image.scalePercent(70);
    cell = new PdfPCell(image);
    cell.setPadding(1);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
    table.addCell(cell);

    image = Image.getInstance("screen_shoot6.gif");
    image.scalePercent(70);
    cell = new PdfPCell(image);
    cell.setPadding(1);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
    table.addCell(cell);

    //      doc.add(new Paragraph("\n"));
    doc.add(table);
}

From source file:tk.diginspect.main.SoOFSignatories.java

private void insertCell(PdfPTable table, String text, int align, int colspan, String color,
        float BorderWidthTop, float BorderWidthBottom) {

    PdfPCell cell = new PdfPCell(new Paragraph(Font.TIMES_ROMAN, text));
    cell.setHorizontalAlignment(align);
    cell.setColspan(colspan);/*from w  ww .j a  v a2s .  co  m*/
    cell.setBackgroundColor(WebColors.getRGBColor(color));
    cell.setPadding(5);
    cell.setBorderWidthTop(BorderWidthTop);
    cell.setBorderWidthBottom(BorderWidthBottom);
    table.addCell(cell);
}

From source file:tk.diginspect.main.SoOFSignatories.java

private void Checked(PdfPTable table, int align, int checkmark) {
    try {/*  w ww. java2s .c o  m*/
        ByteArrayOutputStream streamChecked = new ByteArrayOutputStream();
        Bitmap Checked = BitmapFactory.decodeResource(getBaseContext().getResources(), checkmark);
        Checked.compress(Bitmap.CompressFormat.JPEG, 100, streamChecked);
        Image ImgChecked = null;
        ImgChecked = Image.getInstance(streamChecked.toByteArray());
        ImgChecked.scalePercent(25f);
        PdfPCell cell = new PdfPCell(ImgChecked, false);
        cell.setHorizontalAlignment(align);
        cell.setPadding(5);
        cell.setBorder(0);
        table.addCell(cell);
    } catch (BadElementException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (MalformedURLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

From source file:tk.diginspect.main.SoOFSignatories.java

private void sig(PdfPTable table, String image) {
    try {/* www.  ja v  a 2  s . c  o  m*/
        FileInputStream fis = openFileInput(image);
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        Bitmap bitmap = BitmapFactory.decodeStream(fis);
        bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);
        Image Img = null;
        Img = Image.getInstance(stream.toByteArray());
        Img.scalePercent(10f);
        PdfPCell cell = new PdfPCell(Img, false);
        cell.setPadding(10);
        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        cell.setBorderWidthBottom(0);
        table.addCell(cell);
    } catch (MalformedURLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (BadElementException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

From source file:uk.ac.ox.oucs.vle.resources.PDFWriter.java

License:Educational Community License

private PdfPCell headCell(String name, Font font) {

    PdfPCell pdfCell = new PdfPCell(new Phrase(name, font));
    pdfCell.setMinimumHeight(font.getSize() * 2f);
    pdfCell.setHorizontalAlignment(Element.ALIGN_LEFT);
    pdfCell.setVerticalAlignment(Element.ALIGN_CENTER);
    pdfCell.setPaddingBottom(font.getSize() * 0.5f);
    pdfCell.setPaddingTop(font.getSize() * 0.5f);
    pdfCell.setPaddingLeft(font.getSize());
    pdfCell.setPaddingRight(font.getSize());
    return pdfCell;
}

From source file:uk.ac.ox.oucs.vle.resources.PDFWriter.java

License:Educational Community License

private PdfPCell nameCell(String name, String webauthId, String department) {

    Phrase phrase = new Phrase();
    phrase.add(new Chunk(name, tableNameFont));
    phrase.add(Chunk.NEWLINE);/*w  w  w  .  j  a  va2  s  .  com*/
    StringBuilder otherDetails = new StringBuilder();
    if (webauthId != null && webauthId.trim().length() > 0) {
        otherDetails.append(webauthId);
    }
    if (department != null && department.trim().length() > 0) {
        if (otherDetails.length() > 0) {
            otherDetails.append(" ");
        }
        otherDetails.append(department);
    }
    phrase.add(new Chunk(otherDetails.toString(), tableOtherFont));

    PdfPCell pdfCell = new PdfPCell(phrase);
    pdfCell.setMinimumHeight(tableNameFont.getSize() * 2f);
    pdfCell.setHorizontalAlignment(Element.ALIGN_LEFT);
    pdfCell.setVerticalAlignment(Element.ALIGN_CENTER);
    pdfCell.setPaddingBottom(tableNameFont.getSize() * 0.5f);
    pdfCell.setPaddingTop(tableNameFont.getSize() * 0.5f);
    pdfCell.setPaddingLeft(tableNameFont.getSize());
    pdfCell.setPaddingRight(tableNameFont.getSize());
    return pdfCell;
}