Example usage for com.lowagie.text Paragraph Paragraph

List of usage examples for com.lowagie.text Paragraph Paragraph

Introduction

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

Prototype

public Paragraph(Phrase phrase) 

Source Link

Document

Constructs a Paragraph with a certain Phrase.

Usage

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

License:GNU General Public License

@Override
public void startChapter(String pStrChapterTitle) {

    Font lFont = new Font();
    lFont.setFamily(mFont.getFamilyname());
    lFont.setSize(mFont.getSize());/*from w w  w  .  j  ava2  s .  com*/
    lFont.setStyle(Font.BOLD);

    Anchor anchor = new Anchor(pStrChapterTitle, lFont);
    anchor.setName(pStrChapterTitle);

    mChapter = new Chapter(new Paragraph(anchor), ++mIntChapterPosition);
    addEmptyLines(1);
}

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 {/* w  w w  .  j av a2  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.bibisco.export.ITextExporter.java

License:GNU General Public License

@Override
public void addEmptyLines(int pIntLinesNumber) {

    try {/*ww w .  java2s  .co m*/
        for (int i = 0; i < pIntLinesNumber; i++) {
            if (mSubSection != null) {
                mSubSection.add(new Paragraph(" "));
            } else if (mSection != null) {
                mSection.add(new Paragraph(" "));
            } else if (mChapter != null) {
                mChapter.add(new Paragraph(" "));
            } else {
                mDocument.add(new Paragraph(" "));
            }
        }
    } catch (DocumentException e) {
        mLog.error(e);
        throw new BibiscoException(e, BibiscoException.IO_EXCEPTION);
    }
}

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

License:GNU General Public License

@Override
public void startSection(String pStrSectionTitle) {

    Font lFont = new Font();
    lFont.setFamily(mFont.getFamilyname());
    lFont.setSize(mFont.getSize());/*from  w  w w  .  j  a  v  a  2  s .  c  o  m*/
    lFont.setStyle(Font.ITALIC);

    Anchor anchor = new Anchor(pStrSectionTitle, lFont);
    anchor.setName(pStrSectionTitle);

    mSection = mChapter.addSection(new Paragraph(anchor));
}

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

License:GNU General Public License

@Override
public void startSubSection(String pStrSubSectionTitle) {
    Font lFont = new Font();
    lFont.setFamily(mFont.getFamilyname());
    lFont.setSize(mFont.getSize());//from  ww w  . ja va2s. c  om

    Anchor anchor = new Anchor(pStrSubSectionTitle, lFont);
    anchor.setName(pStrSubSectionTitle);

    addEmptyLines(1);
    mSubSection = mSection.addSection(new Paragraph(anchor));
    addEmptyLines(1);

}

From source file:com.concursive.connect.web.modules.wiki.utils.WikiPDFUtils.java

License:Open Source License

protected static String parseForm(WikiPDFContext context, Connection db, BufferedReader in, String line,
        Document document, PdfPCell cell) throws Exception {
    if (line == null) {
        return line;
    }//from   w  w w. j a v  a 2 s. c om
    CustomForm form = WikiToHTMLUtils.retrieveForm(in, line);
    LOG.debug("parseForm");
    for (CustomFormGroup group : form) {
        LOG.debug(" group...");
        // Start the table

        PdfPTable pdfTable = new PdfPTable(2);
        pdfTable.setHorizontalAlignment(Element.ALIGN_LEFT);
        pdfTable.setSpacingBefore(10);
        //      pdfTable.setWidthPercentage(100);
        pdfTable.setKeepTogether(true);

        if (group.getDisplay() && StringUtils.hasText(group.getName())) {
            // output the 1st row with a colspan of 2
            if (StringUtils.hasText(group.getName())) {
                Paragraph groupParagraph = new Paragraph(group.getName());
                PdfPCell groupCell = new PdfPCell(groupParagraph);
                groupCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                groupCell.setColspan(2);
                groupCell.setPadding(20);
                groupCell.setBorderColor(new Color(100, 100, 100));
                groupCell.setBackgroundColor(new Color(200, 200, 200));
                groupCell.setNoWrap(true);
                pdfTable.addCell(groupCell);
            }
        }
        for (CustomFormField field : group) {
            LOG.debug("  field...");
            if (field.hasValue()) {
                // output the row (2 columns: label, value)
                Paragraph fieldLabelParagraph = new Paragraph(field.getLabel());
                PdfPCell fieldLabelCell = new PdfPCell(fieldLabelParagraph);
                fieldLabelCell.setPadding(20);
                fieldLabelCell.setBorderColor(new Color(100, 100, 100));
                //          fieldLabelCell.setNoWrap(true);
                pdfTable.addCell(fieldLabelCell);

                Paragraph fieldValueParagraph = new Paragraph(getFieldValue(context, field));
                PdfPCell fieldValueCell = new PdfPCell(fieldValueParagraph);
                fieldValueCell.setPadding(20);
                fieldValueCell.setBorderColor(new Color(100, 100, 100));
                //          fieldValueCell.setNoWrap(true);
                pdfTable.addCell(fieldValueCell);
            }
        }
        LOG.debug("document.add(pdfTable)");
        document.add(pdfTable);

    }
    return null;
}

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);//w ww .ja v  a  2s .  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  w  w .j  a  v a 2s  .co 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);
}

From source file:com.conecta.sat.utils.BuildBitacoraPDF.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.
    hsr1.setContentType("application/pdf");
    DateFormat name = new SimpleDateFormat("ddMMyyyyhhmmss");
    hsr1.setHeader("Content-disposition", "attachment; filename=Bitacora" + name.format(new Date()) + ".pdf");
    List<BitacoraPDF> list = (List<BitacoraPDF>) map.get("listBitacora");
    String nombreUsuario = (String) map.get("nombreUsuario");

    PdfPTable table = new PdfPTable(columnas);
    table.setWidthPercentage(100);/*w  w  w  .j a va2 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("Bitcora de Actividades", 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(df.format(new Date()), font);
    fecha.setAlignment(Element.ALIGN_RIGHT);
    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 de usuario", font));
    table.addCell(cell);

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

    cell.setPhrase(new Phrase("ltima fecha de Modificaciones", 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
    df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    for (BitacoraPDF bitacora : list) {
        cell = new PdfPCell();
        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        cell.addElement(new Phrase(bitacora.getNombre(), font2));
        table.addCell(cell);
        cell = new PdfPCell();
        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        cell.addElement(new Phrase(bitacora.getMensaje(), font2));
        table.addCell(cell);
        cell = new PdfPCell();
        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        cell.addElement(new Phrase(bitacora.getFecha(), font2));
        table.addCell(cell);
        cell = new PdfPCell();
    }

    document.add(table);
}

From source file:com.conecta.sat.utils.BuildDesactivarSoftPDF.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=DesactivarToken" + 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 w  w .j a  v a 2  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("Desactivacin 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("Cambio de Status Correcto", 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);
    if (list.getToken().length() < 8) {
        list.setTipo("SoftToken");
    } else {
        list.setTipo("HardToken");
    }

    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() > 8) {
        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);
}