Example usage for com.lowagie.text Element ALIGN_RIGHT

List of usage examples for com.lowagie.text Element ALIGN_RIGHT

Introduction

In this page you can find the example usage for com.lowagie.text Element ALIGN_RIGHT.

Prototype

int ALIGN_RIGHT

To view the source code for com.lowagie.text Element ALIGN_RIGHT.

Click Source Link

Document

A possible value for paragraph alignment.

Usage

From source file:ch.gpb.elexis.kgexporter.pdf.HeaderFooterPageEvent.java

License:Open Source License

public void onStartPage(PdfWriter writer, Document document) {
    Rectangle rect = writer.getBoxSize("art");

    ColumnText.showTextAligned(writer.getDirectContent(), Element.ALIGN_LEFT, new Phrase(sbHeader),
            rect.getLeft(), rect.getTop(), 0);

    ColumnText.showTextAligned(writer.getDirectContent(), Element.ALIGN_RIGHT, new Phrase(sDate),
            rect.getRight(), rect.getTop(), 0);

    PdfContentByte cb = writer.getDirectContentUnder();

    //cb.rectangle(document.left(), document.top(),
    //   document.right() - document.left(), document.top() - 25);
    /*/*from  w  w  w  . ja v  a  2  s .c o m*/
    System.out.println("l: " + document.left());
    System.out.println("r: " + document.right());
    System.out.println("t: " + document.top());
    System.out.println("b: " + document.bottom());
    l: 36.0
    r: 559.0
    t: 806.0
    b: 36.0
    */

    //Rectangle rect2 = new Rectangle(document.top() - 36, document.top() - 36, 559, 1);

    /*
    float l = 36f;
    float r = 36f;
    float t = 559f;
    float b = 2f;
            
    Rectangle rect2 = new Rectangle(l, r, t, b);
            
    //Rectangle rect2 = new Rectangle(36, 36, 559, 1);
    rect2.setBorder(Rectangle.BOTTOM);
    rect2.setBorderWidth(0.5f);
    cb.rectangle(rect2);
            
    //cb.setColorStroke(Color.BLACK);
    */

    /*
    for (int i = 30; i > 0; i--) {
        System.err.println((float) i / 10);
        cb.setLineWidth((float) i / 10);
        cb.moveTo(36, 806 - (5 * i));
        cb.lineTo(400, 806 - (5 * i));
        cb.stroke();
    }
    cb.moveTo(10, 50);
    cb.lineTo(559, 50);
     */
    cb.setLineWidth(0.5f);
    cb.moveTo(30, 791);
    cb.lineTo(559, 791);

    cb.stroke();

}

From source file:classroom.filmfestival_c.Movies19.java

protected static void drawGrid(PdfWriter writer, List<String> places, String day, float left,
        float column_width, float top, float row_height) {

    // CANVAS//from   www  .  ja  va  2s .c  o  m
    PdfContentByte directcontent = writer.getDirectContent();
    Rectangle art = writer.getBoxSize("art");

    // LINES

    directcontent.setLineWidth(1);
    float bottom = art.getTop();

    // rows
    int rows = places.size();
    for (int i = 0; i <= rows; i++) {
        directcontent.moveTo(art.getLeft(), art.getTop() - (i * row_height));
        directcontent.lineTo(art.getRight(), art.getTop() - (i * row_height));
        bottom = art.getTop() - (i * row_height);
    }

    // Rectangle
    directcontent.moveTo(art.getLeft(), art.getTop());
    directcontent.lineTo(art.getLeft(), bottom);
    directcontent.moveTo(left, art.getTop());
    directcontent.lineTo(left, bottom);
    directcontent.moveTo(art.getLeft() + (COLUMNS * column_width), art.getTop());
    directcontent.lineTo(art.getLeft() + (COLUMNS * column_width), bottom);
    directcontent.stroke();

    // columns
    directcontent.saveState();
    directcontent.setLineWidth(0.3f);
    directcontent.setColorStroke(SILVER);
    directcontent.setLineDash(3, 1);
    for (int i = 2; i < COLUMNS; i++) {
        directcontent.moveTo(art.getLeft() + (i * column_width), art.getTop());
        directcontent.lineTo(art.getLeft() + (i * column_width), bottom);
    }
    directcontent.stroke();
    directcontent.restoreState();

    // TEXT

    // date
    directcontent.beginText();
    directcontent.setFontAndSize(FONT, 12);
    directcontent.showTextAligned(Element.ALIGN_RIGHT, day, art.getLeft() - 5, art.getTop(), 90);
    directcontent.endText();

    // time
    for (int i = 1; i < COLUMNS; i++) {
        directcontent.beginText();
        directcontent.setFontAndSize(FONT, 8);
        directcontent.showTextAligned(Element.ALIGN_LEFT, TIME[i - 1], art.getLeft() + (i * column_width) + 5,
                top + 5, 90);
        directcontent.endText();
    }

    // places
    for (int i = 0; i < rows; i++) {
        directcontent.beginText();
        directcontent.setFontAndSize(FONT, 12);
        directcontent.showTextAligned(Element.ALIGN_CENTER, places.get(i), art.getLeft() + 16,
                art.getTop() - ((i + 0.5f) * row_height), 90);
        directcontent.endText();
    }
}

From source file:classroom.newspaper_b.Newspaper10.java

public static void main(String[] args) {
    try {/*from  w  w  w. j  a  v a  2 s.c o  m*/
        PdfReader reader = new PdfReader(NEWSPAPER);
        PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(RESULT));
        PushbuttonField button;
        Rectangle rect;

        rect = new Rectangle(100, 980, 700, 1000);
        button = new PushbuttonField(stamper.getWriter(), rect, "click");
        button.setBackgroundColor(Color.ORANGE);
        button.setText("Click here to close window");
        button.setLayout(PushbuttonField.LAYOUT_LABEL_ONLY);
        button.setAlignment(Element.ALIGN_RIGHT);
        PdfFormField menubar = button.getField();
        String js = "var f1 = getField('click'); f1.display = display.hidden;"
                + "var f2 = getField('advertisement'); f2.display = display.hidden;";
        menubar.setAction(PdfAction.javaScript(js, stamper.getWriter()));
        stamper.addAnnotation(menubar, 1);

        rect = new Rectangle(100, 500, 700, 980);
        button = new PushbuttonField(stamper.getWriter(), rect, "advertisement");
        button.setBackgroundColor(Color.WHITE);
        button.setBorderColor(Color.ORANGE);
        button.setImage(Image.getInstance(IMG));
        button.setText("Buy the book iText in Action");
        button.setLayout(PushbuttonField.LAYOUT_LABEL_TOP_ICON_BOTTOM);
        PdfFormField advertisement = button.getField();
        advertisement.setAction(new PdfAction("http://www.1t3xt.com/docs/book.php"));
        stamper.addAnnotation(advertisement, 1);
        stamper.close();
    } catch (IOException e) {
        e.printStackTrace();
    } catch (DocumentException e) {
        e.printStackTrace();
    }
}

From source file:com.actelion.research.spiritapp.ui.util.PDFUtils.java

License:Open Source License

public static void addHeader(PdfWriter writer, String header) {
    class MyFooter extends PdfPageEventHelper {
        com.lowagie.text.Font ffont;

        @Override/*  w  w w  .  ja  va  2s  . co m*/
        public void onEndPage(PdfWriter writer, Document document) {
            try {
                ffont = new com.lowagie.text.Font(
                        BaseFont.createFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.EMBEDDED), 6f,
                        com.lowagie.text.Font.ITALIC);
            } catch (Exception e) {
                e.printStackTrace();
                return;
            }

            String date = FormatterUtils.formatDateTime(new Date());
            PdfContentByte cb = writer.getDirectContent();
            ColumnText.showTextAligned(cb, Element.ALIGN_LEFT, new Phrase(header, ffont), document.left(),
                    document.top() + 5, 0);
            ColumnText.showTextAligned(cb, Element.ALIGN_CENTER,
                    new Phrase("Page " + writer.getCurrentPageNumber(), ffont),
                    (document.right() - document.left()) / 2 + document.leftMargin(), document.bottom() - 5, 0);
            ColumnText.showTextAligned(cb, Element.ALIGN_RIGHT, new Phrase(date, ffont), document.right(),
                    document.bottom() - 5, 0);
        }
    }
    writer.setPageEvent(new MyFooter());
}

From source file:com.aryjr.nheengatu.pdf.PDFTable.java

License:Open Source License

public static PDFTable createTable(final Tag htmlTable) throws DocumentException {
    // TODO Do not use <tfoot> tag !!! Inside a <table> only <thead>,
    // <tbody> and <tr>.
    // TODO If you are using a <thead>, you can use only <tbody> inside a
    // <table>.
    // TODO If you do not use <thead>, you can use only <tr>
    int headerRowCount = 0;
    if (htmlTable.getFirstTag("thead") != null || htmlTable.getFirstTag("tbody") != null) {
        // Before I will remove the <thead> and <tbody> tags
        headerRowCount = PDFTable.removeTheadTbody(htmlTable);
    }/*  w  ww.j  av a  2 s  .c  om*/
    // Now, I will remove all rowspans from table and convert it to
    // nestedTables
    headerRowCount -= PDFTable.removeAllRowspans(htmlTable);
    // Creating the iText table
    PDFTable table;
    final TagsManager tm = TagsManager.getInstance();
    int maxCols = 0;// The max number of cells in this table
    final Iterator rows = htmlTable.tags();
    Tag row;
    while (rows.hasNext()) {
        row = (Tag) rows.next();
        if (maxCols < row.tagsCollection().size()) {
            maxCols = row.tagsCollection().size();
        }
    }
    table = new PDFTable(maxCols);
    table.setHeaderRows(headerRowCount < 0 ? 0 : headerRowCount);
    tm.checkTag(htmlTable);
    final CellWidths cws = new CellWidths();
    PDFTable.createTableRows(htmlTable, htmlTable, table, cws);
    tm.back();
    String align = htmlTable.getPropertyValue("align");
    if (align != null) {
        align = align.toLowerCase();
        if (align.equals("left"))
            table.setHorizontalAlignment(Element.ALIGN_LEFT);
        else if (align.equals("right"))
            table.setHorizontalAlignment(Element.ALIGN_RIGHT);
        else if (align.equals("center"))
            table.setHorizontalAlignment(Element.ALIGN_CENTER);
    }
    final String width = htmlTable.getPropertyValue("width");
    // table.setLockedWidth(true);
    if (width != null && width.indexOf('%') > 0) {
        // TODO what is the reference for the % here? See the method
        // table.setWidthPercentage(float[] , Rectangle).
        table.setWidthPercentage(Float.parseFloat(width.substring(0, width.length() - 1)));
    } else if (width != null) {
        table.setTotalWidth(Float.parseFloat(width));
    }
    return table;
}

From source file:com.bibisco.export.ITextExporter.java

License:GNU General Public License

@Override
public void startParagraph(ParagraphAligment pParagraphAligment, boolean pBlnParagraphIndent) {

    mLog.debug("Start startParagraph()");

    mParagraph = new Paragraph(22);
    if (pBlnParagraphIndent) {
        mParagraph.setFirstLineIndent(PARAGRAPH_FIRST_LINE_INDENT);
    } else {/*from  ww  w. ja  va  2 s .com*/
        mParagraph.setFirstLineIndent(0);
    }

    switch (pParagraphAligment) {
    case LEFT:
        mParagraph.setAlignment(Element.ALIGN_LEFT);
        break;
    case CENTER:
        mParagraph.setAlignment(Element.ALIGN_CENTER);
        break;
    case RIGHT:
        mParagraph.setAlignment(Element.ALIGN_RIGHT);
        break;
    case JUSTIFY:
        mParagraph.setAlignment(Element.ALIGN_JUSTIFIED);
        break;

    default:
        break;
    }

    mLog.debug("End startParagraph()");
}

From source file:com.bytecode.customexporter.PDFCustomExporter.java

protected PdfPCell addColumnAlignments(UIComponent component, PdfPCell cell) {
    if (component instanceof HtmlOutputText) {
        HtmlOutputText output = (HtmlOutputText) component;
        if (output.getStyle() != null && output.getStyle().contains("left")) {
            cell.setHorizontalAlignment(Element.ALIGN_LEFT);
        }//from  w w  w. j  a va2 s  . c  om
        if (output.getStyle() != null && output.getStyle().contains("right")) {
            cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
        }
        if (output.getStyle() != null && output.getStyle().contains("center")) {
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        }
    }
    return cell;
}

From source file:com.bytecode.customexporter.PDFCustomExporter.java

protected PdfPCell addFacetAlignments(UIComponent component, PdfPCell cell) {
    if (component instanceof HtmlOutputText) {
        HtmlOutputText output = (HtmlOutputText) component;
        if (output.getStyle() != null && output.getStyle().contains("left")) {
            cell.setHorizontalAlignment(Element.ALIGN_LEFT);
        } else if (output.getStyle() != null && output.getStyle().contains("right")) {
            cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
        } else {/*from  w w  w.ja v  a 2 s .  c o m*/
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        }
    }
    return cell;
}

From source file:com.conecta.sat.utils.BuildAsignaSoftPDF.java

@Override
protected void buildPdfDocument(Map<String, Object> map, Document document, PdfWriter writer,
        HttpServletRequest hsr, HttpServletResponse hsr1) throws Exception {
    //        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    System.out.println("Into BuildImportTokensPDF");
    hsr1.setContentType("application/pdf");
    DateFormat name = new SimpleDateFormat("ddMMyyyyhhmmss");
    hsr1.setHeader("Content-disposition",
            "attachment; filename=AsignaToken" + name.format(new Date()) + ".pdf");
    AsignaSoftPDF list = (AsignaSoftPDF) map.get("list");
    String nombreUsuario = (String) map.get("nombreUsuario");

    PdfPTable table = new PdfPTable(5);
    table.setWidthPercentage(100);//from w  ww. ja  va2 s .  c om
    table.setSpacingBefore(10);

    Font font = FontFactory.getFont(FontFactory.HELVETICA);
    try {
        font.setFamily(fontName);
    } catch (Exception e) {
        font.setFamily("Verdana");
    }

    try {
        ServletContext servletContext = hsr.getSession().getServletContext();
        String relativeWebPath = logoPath;
        String absoluteDiskPath = servletContext.getRealPath(relativeWebPath);
        Image logo = Image.getInstance(absoluteDiskPath);
        //            Image logo = Image.getInstance("logo.png");
        System.out.println("La imagen se cargo correctamente");
        logo.scaleToFit(widthLogo, heightLogo);
        document.add(logo);
    } catch (Exception e) {
        System.err.println("ERROR" + Excepciones.getStackTrace(e));
        document.add(new Paragraph("Sin imagen " + logoPath));
    }
    font.setSize(fontSize + 3);
    Paragraph titulo = new Paragraph("Asignacin de Token a cliente", font);
    titulo.setAlignment(Element.ALIGN_RIGHT);
    document.add(titulo);

    Chunk CONNECT = new Chunk(new LineSeparator(0.5f, 100, java.awt.Color.BLACK, Element.ALIGN_CENTER, 3.5f));
    document.add(CONNECT);

    DateFormat df = new SimpleDateFormat("dd/MM/yyyy hh:mm a");
    font.setSize(fontSize + 2);
    Paragraph fecha = new Paragraph("Asignacin Correcta", font);
    fecha.setAlignment(Element.ALIGN_CENTER);
    document.add(fecha);

    //        Paragraph pNombre = new Paragraph( nombreUsuario , font);
    //        pNombre.setAlignment(Element.ALIGN_RIGHT);
    //        document.add(pNombre);

    font.setSize(fontSize);
    font.setColor(java.awt.Color.white);

    // define table header cell
    PdfPCell cell = new PdfPCell();
    java.awt.Color color = java.awt.Color.LIGHT_GRAY;
    cell.setBackgroundColor(color);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);

    cell.setPadding(5);

    // write table header
    cell.setPhrase(new Phrase("Nombre empleado", font));
    table.addCell(cell);

    cell.setPhrase(new Phrase("Fecha y Hora", font));
    table.addCell(cell);

    cell.setPhrase(new Phrase("Cliente", font));
    table.addCell(cell);

    cell.setPhrase(new Phrase("Token", font));
    table.addCell(cell);

    cell.setPhrase(new Phrase("Tipo de Token", font));
    table.addCell(cell);

    //        cell.setPhrase(new Phrase("Centro Financiero", font));
    //        table.addCell(cell);
    //         
    //        cell.setPhrase(new Phrase("Tipo", font));
    //        table.addCell(cell);
    //        
    //        cell.setPhrase(new Phrase("Cliente nico", font));
    //        table.addCell(cell);
    //        
    //        cell.setPhrase(new Phrase("Fecha de ultima modificacin", font));
    //        table.addCell(cell);

    Font font2 = FontFactory.getFont(FontFactory.HELVETICA);
    try {
        font2.setFamily(fontName);
    } catch (Exception e) {
        font2.setFamily("Verdana");
    }
    font2.setSize(fontSize);
    font2.setColor(java.awt.Color.black);
    // write table row data
    //        for (ImportTokensPDF pdf : list) {
    //        ImportTokensPDF pdf;
    cell = new PdfPCell();
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.addElement(new Phrase(list.getNombre(), font2));
    table.addCell(cell);

    cell = new PdfPCell();
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.addElement(new Phrase(df.format(list.getFecha()), font2));
    table.addCell(cell);

    cell = new PdfPCell();
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.addElement(new Phrase(list.getCliente(), font2));
    table.addCell(cell);

    if (list.getToken().length() >= 14) {
        list.setTipo("SOFTTOKEN");
    } else {
        list.setTipo("HARDTOKEN");
    }

    cell = new PdfPCell();
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.addElement(new Phrase(list.getToken(), font2));
    table.addCell(cell);

    cell = new PdfPCell();
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.addElement(new Phrase(list.getTipo(), font2));
    table.addCell(cell);

    //            cell = new PdfPCell();
    //            cell.setHorizontalAlignment( Element.ALIGN_CENTER );
    //            cell.addElement( new Phrase(pdf.getCentro(),font2) );
    //            table.addCell(cell);
    //            
    //            cell = new PdfPCell();
    //            cell.setHorizontalAlignment( Element.ALIGN_CENTER );
    //            cell.addElement( new Phrase(pdf.getTipo(),font2) );
    //            table.addCell(cell);
    //            
    //            cell = new PdfPCell();
    //            cell.setHorizontalAlignment( Element.ALIGN_CENTER );
    //            cell.addElement( new Phrase(pdf.getCliente(),font2) );
    //            table.addCell(cell);
    //            
    //            cell = new PdfPCell();
    //            cell.setHorizontalAlignment( Element.ALIGN_CENTER );
    //            cell.addElement( new Phrase(pdf.getLastUpdate(),font2) );
    //            table.addCell(cell);
    //        }

    document.add(table);
}

From source file:com.conecta.sat.utils.BuildAsignaTokenCenFinPDF.java

@Override
protected void buildPdfDocument(Map<String, Object> map, Document document, PdfWriter writer,
        HttpServletRequest hsr, HttpServletResponse hsr1) throws Exception {
    //        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    System.out.println("Into BuildImportTokensPDF");
    hsr1.setContentType("application/pdf");
    DateFormat name = new SimpleDateFormat("ddMMyyyyhhmmss");
    hsr1.setHeader("Content-disposition",
            "attachment; filename=AsignacionTokensCentroFinanciero" + name.format(new Date()) + ".pdf");
    AsignaTokenCenFinPDF list = (AsignaTokenCenFinPDF) map.get("list");
    String nombreUsuario = (String) map.get("nombreUsuario");

    PdfPTable table = new PdfPTable(2);
    table.setWidthPercentage(100);//from   w ww .  ja  v  a2 s  .c o  m
    table.setSpacingBefore(10);

    Font font = FontFactory.getFont(FontFactory.HELVETICA);
    try {
        font.setFamily(fontName);
    } catch (Exception e) {
        font.setFamily("Verdana");
    }

    try {
        ServletContext servletContext = hsr.getSession().getServletContext();
        String relativeWebPath = logoPath;
        String absoluteDiskPath = servletContext.getRealPath(relativeWebPath);
        Image logo = Image.getInstance(absoluteDiskPath);
        //            Image logo = Image.getInstance("logo.png");
        System.out.println("La imagen se cargo correctamente");
        logo.scaleToFit(widthLogo, heightLogo);
        document.add(logo);
    } catch (Exception e) {
        System.err.println("ERROR" + Excepciones.getStackTrace(e));
        document.add(new Paragraph("Sin imagen " + logoPath));
    }
    font.setSize(fontSize + 3);
    Paragraph titulo = new Paragraph("Asignacin de Hard Token", font);
    titulo.setAlignment(Element.ALIGN_RIGHT);
    document.add(titulo);

    Chunk CONNECT = new Chunk(new LineSeparator(0.5f, 100, java.awt.Color.BLACK, Element.ALIGN_CENTER, 3.5f));
    document.add(CONNECT);

    DateFormat df = new SimpleDateFormat("dd/MM/yyyy hh:mm a");
    font.setSize(fontSize + 2);
    Paragraph fecha = new Paragraph("Asignacin de Tokens a Centro Financiero", font);
    fecha.setAlignment(Element.ALIGN_CENTER);
    document.add(fecha);

    //        Paragraph pNombre = new Paragraph( nombreUsuario , font);
    //        pNombre.setAlignment(Element.ALIGN_RIGHT);
    //        document.add(pNombre);

    font.setSize(fontSize);
    font.setColor(java.awt.Color.white);

    // define table header cell
    PdfPCell cell = new PdfPCell();
    java.awt.Color color = java.awt.Color.LIGHT_GRAY;
    cell.setBackgroundColor(color);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);

    cell.setPadding(5);

    // write table header
    //        cell.setPhrase(new Phrase("Usuario que importo en token", font));
    //        table.addCell(cell);
    //         
    //        cell.setPhrase(new Phrase("Fecha y Hora", font));
    //        table.addCell(cell);
    //        
    //        cell.setPhrase(new Phrase("Tokens importados", font));
    //        table.addCell(cell);

    //        cell.setPhrase(new Phrase("Centro Financiero", font));
    //        table.addCell(cell);
    //         
    //        cell.setPhrase(new Phrase("Tipo", font));
    //        table.addCell(cell);
    //        
    //        cell.setPhrase(new Phrase("Cliente nico", font));
    //        table.addCell(cell);
    //        
    //        cell.setPhrase(new Phrase("Fecha de ultima modificacin", font));
    //        table.addCell(cell);

    Font font2 = FontFactory.getFont(FontFactory.HELVETICA);
    try {
        font2.setFamily(fontName);
    } catch (Exception e) {
        font2.setFamily("Verdana");
    }
    font2.setSize(fontSize);
    font2.setColor(java.awt.Color.black);
    // write table row data
    //        for (ImportTokensPDF pdf : list) {
    //        ImportTokensPDF pdf;
    cell = new PdfPCell();
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.addElement(new Phrase("Nombre empleado", font2));
    table.addCell(cell);

    cell = new PdfPCell();
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.addElement(new Phrase(list.getNombre(), font2));
    table.addCell(cell);

    cell = new PdfPCell();
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.addElement(new Phrase("Fecha de Asignacin", font2));
    table.addCell(cell);

    cell = new PdfPCell();
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.addElement(new Phrase(df.format(list.getFecha()), font2));
    table.addCell(cell);

    cell = new PdfPCell();
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.addElement(new Phrase("Centro Financiero asignado", font2));
    table.addCell(cell);

    cell = new PdfPCell();
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.addElement(new Phrase(list.getCentroFinanciero(), font2));
    table.addCell(cell);

    cell = new PdfPCell();
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.addElement(new Phrase("Tokens asignados", font2));
    table.addCell(cell);

    cell = new PdfPCell();
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.addElement(new Phrase(list.getTokens(), font2));
    table.addCell(cell);

    document.add(table);
}