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(float leading, String string) 

Source Link

Document

Constructs a Paragraph with a certain String and a certain leading.

Usage

From source file:Cotizacion.ExportarPDF.java

private static void acomodarATTE(Paragraph datosCentro) throws BadElementException {
    ate = PanelCotizacion.labelATE.getText();
    nombre = PanelCotizacion.labelNombre.getText();
    datosCentro.add(new Paragraph(ate, fuenteNegrita2));
    datosCentro.add(new Paragraph(nombre, fuenteNegrita2));
    datosCentro.setAlignment(1);//from ww  w.ja v a2 s  .  c om
}

From source file:Cotizacion.ExportarPDF.java

private static void acomodarDatosNota(Paragraph datosNormal2) throws BadElementException {
    nota1 = PanelCotizacion.labelNota1.getText();
    leyenda = PanelCotizacion.areaLeyenda.getText();
    agregarLineasEnBlanco(datosNormal2, 5);
    datosNormal2.add(new Paragraph(nota1, fuenteChiquita));
    datosNormal2.add(new Paragraph(leyenda, fuenteChiquita));
    datosNormal2.setAlignment(0);//from   w w  w.  j  ava2 s . com
}

From source file:CPS.Core.TODOLists.PDFExporter.java

License:Open Source License

public void addTable(JTable jtable, String tableTitle) {
    try {/* ww  w.  j a  v  a  2 s .  c  o  m*/
        if (tableTitle != null) {
            tempDoc.add(new Paragraph(tableTitle, fontPageHeader));
        }
        tempDoc.add(new Paragraph(Chunk.NEWLINE)); // TODO halve the height of this
        PdfPTable t = convertJTable(jtable);
        t.setWidthPercentage(100); // 100% page width
        tempDoc.add(t);
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:datasoul.servicelist.ServiceListExporterDocument.java

License:Open Source License

public void addServicePlan() throws DocumentException {

    ServiceListTable slt = ServiceListTable.getActiveInstance();

    Paragraph p = new Paragraph(
            java.util.ResourceBundle.getBundle("datasoul/internationalize").getString("SERVICE PLAN"),
            FontFactory.getFont(FontFactory.HELVETICA, 12));
    p.setAlignment(Element.ALIGN_CENTER);
    document.add(p);/*from ww w.ja v  a 2s.  c  o m*/

    p = new Paragraph(slt.getTitle(), FontFactory.getFont(FontFactory.HELVETICA_BOLD, 16));
    p.setAlignment(Element.ALIGN_CENTER);
    document.add(p);

    Table t = new Table(4);
    t.setWidths(new int[] { 10, 5, 50, 35 });
    t.setPadding(2.0f);
    t.setWidth(100.0f);

    t.addCell(createHeaderCell(
            java.util.ResourceBundle.getBundle("datasoul/internationalize").getString("TIME")));
    t.addCell(
            createHeaderCell(java.util.ResourceBundle.getBundle("datasoul/internationalize").getString("MIN")));
    t.addCell(createHeaderCell(
            java.util.ResourceBundle.getBundle("datasoul/internationalize").getString("TITLE")));
    t.addCell(createHeaderCell(
            java.util.ResourceBundle.getBundle("datasoul/internationalize").getString("NOTES")));

    for (int i = 0; i < slt.getRowCount(); i++) {

        ServiceItem si = (ServiceItem) slt.getServiceItem(i);
        Cell c;

        // Start time
        c = new Cell(si.getStartTime());
        c.setMaxLines(1);
        c.setVerticalAlignment(Cell.ALIGN_MIDDLE);
        c.setHorizontalAlignment(Cell.ALIGN_CENTER);
        t.addCell(c);

        // Duration
        c = new Cell(Integer.toString(si.getDuration()));
        c.setMaxLines(1);
        c.setVerticalAlignment(Cell.ALIGN_MIDDLE);
        c.setHorizontalAlignment(Cell.ALIGN_RIGHT);
        t.addCell(c);

        // Title
        c = new Cell(si.getTitle());
        c.setVerticalAlignment(Cell.ALIGN_MIDDLE);
        t.addCell(c);

        // Notes
        c = new Cell(si.getNotes());
        c.setVerticalAlignment(Cell.ALIGN_MIDDLE);
        t.addCell(c);

    }

    document.add(t);

    p = new Paragraph(java.util.ResourceBundle.getBundle("datasoul/internationalize").getString("NOTES"),
            FontFactory.getFont(FontFactory.HELVETICA_BOLD));
    document.add(p);

    p = new Paragraph(slt.getNotes(), FontFactory.getFont(FontFactory.HELVETICA));
    p.setIndentationLeft(10.0f);
    document.add(p);

    document.newPage();

}