Example usage for com.lowagie.text Font HELVETICA

List of usage examples for com.lowagie.text Font HELVETICA

Introduction

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

Prototype

int HELVETICA

To view the source code for com.lowagie.text Font HELVETICA.

Click Source Link

Document

a possible value of a font family.

Usage

From source file:jm.web.Addons.java

License:GNU General Public License

public static void setPie(PdfWriter writer, Document document, String rep_pie) {
    try {/*from   ww  w .  jav a2 s  .  c  o  m*/
        PdfContentByte cb = writer.getDirectContent();
        /*cb.setLineWidth(2);
        cb.moveTo(60, document.bottomMargin()-5);
        cb.lineTo(document.right() - document.left()-70, document.bottomMargin()-5);
        */
        PdfPTable pie = new PdfPTable(1);
        pie.setTotalWidth(document.right() - document.left() - 120);
        pie.addCell(Addons.setCeldaPDF(rep_pie, Font.HELVETICA, 9, Font.BOLD, Element.ALIGN_CENTER, 0));
        pie.addCell(Addons.setCeldaPDF("Pg " + String.valueOf(writer.getPageNumber()), Font.HELVETICA, 9,
                Font.BOLD, Element.ALIGN_RIGHT, 0));
        pie.addCell(Addons.setCeldaPDF(
                "Reporte diseado por: Jorge Mueses Cevallos.      Mvil: 095204832     mail:jorge_mueses@yahoo.com",
                Font.HELVETICA, 5, Font.BOLD, Element.ALIGN_LEFT, 0));
        pie.writeSelectedRows(0, -1, 60, document.bottomMargin() - 10, cb);
    } catch (Exception e) {
        throw new ExceptionConverter(e);
    }
}

From source file:jm.web.Addons.java

License:GNU General Public License

public static PdfPTable setCabeceraTabla(String[] titulo, float[] ancho) {
    PdfPTable encabezado = new PdfPTable(ancho);
    encabezado.setSpacingBefore(5f);/*from  www. j av  a2  s  .c om*/
    for (int i = 0; i < titulo.length; i++) {
        encabezado.addCell(Addons.setCeldaPDF(titulo[i], Font.HELVETICA, 9, Font.BOLD, Element.ALIGN_CENTER, 1,
                Color.cyan)); /*  Color.CYAN  */
    }
    return encabezado;
}

From source file:jm.web.Addons.java

License:GNU General Public License

public static PdfPTable setCabeceraTablaBalance(String[] titulo, float[] ancho) {
    PdfPTable encabezado = new PdfPTable(ancho);
    encabezado.setSpacingBefore(5f);//from w ww. j av a2 s . c o  m
    encabezado.addCell(
            Addons.setCeldaPDF("", Font.HELVETICA, 9, Font.BOLD, Element.ALIGN_CENTER, 1, Color.cyan, 3, 3));
    encabezado.addCell(Addons.setCeldaPDF("SUMAS", Font.HELVETICA, 9, Font.BOLD, Element.ALIGN_CENTER, 1,
            Color.cyan, 3, 2));
    encabezado.addCell(Addons.setCeldaPDF("SALDOS", Font.HELVETICA, 9, Font.BOLD, Element.ALIGN_CENTER, 1,
            Color.cyan, 3, 2));
    for (int i = 0; i < titulo.length; i++) {
        encabezado.addCell(Addons.setCeldaPDF(titulo[i], Font.HELVETICA, 9, Font.BOLD, Element.ALIGN_CENTER, 1,
                Color.cyan)); /*  Color.CYAN  */
    }
    return encabezado;
}

From source file:jm.web.Addons.java

License:GNU General Public License

public static PdfPTable setCabeceraTabla(java.util.List titulo, float[] anchos, float ancho) {
    PdfPTable encabezado = new PdfPTable(anchos);
    encabezado.setWidthPercentage(ancho);
    encabezado.setSpacingBefore(5f);/*from w  w w.ja v a2  s .co  m*/
    java.util.Iterator it = titulo.iterator();
    while (it.hasNext()) {
        encabezado.addCell(Addons.setCeldaPDF((String) it.next(), Font.HELVETICA, 8, Font.BOLD,
                Element.ALIGN_CENTER, 1, Color.cyan)); /*  Color.CYAN  */
    }
    return encabezado;
}

From source file:jmemorize.core.io.PdfRtfBuilder.java

License:Open Source License

private static void writeCategoryHeader(Document doc, Category category) throws DocumentException {
    Chunk chunk = new Chunk(category.getPath());
    chunk.setFont(new Font(Font.HELVETICA, 12, Font.BOLD));

    Paragraph paragraph = new Paragraph(chunk);
    paragraph.setSpacingBefore(1f);/*  w  ww  .j ava 2  s.c o  m*/

    doc.add(paragraph);
}

From source file:org.activityinfo.server.report.renderer.itext.ItextChartRenderer.java

License:Open Source License

@Override
public void render(DocWriter writer, Document doc, PivotChartReportElement element) throws DocumentException {

    doc.add(ThemeHelper.elementTitle(element.getTitle()));
    ItextRendererHelper.addFilterDescription(doc, element.getContent().getFilterDescriptions());
    ItextRendererHelper.addDateFilterDescription(doc, element.getFilter().getDateRange());

    if (element.getContent().getData().isEmpty()) {
        Paragraph para = new Paragraph(I18N.CONSTANTS.noData());
        para.setFont(new Font(Font.HELVETICA, 12, Font.NORMAL, new Color(0, 0, 0)));
        doc.add(para);/*ww w .j a v  a2 s .com*/

    } else {
        float width = doc.getPageSize().getWidth() - doc.rightMargin() - doc.leftMargin();
        float height = (doc.getPageSize().getHeight() - doc.topMargin() - doc.bottomMargin()) / 3f;

        renderImage(writer, doc, element, width, height);
    }
}

From source file:org.activityinfo.server.report.renderer.itext.ThemeHelper.java

License:Open Source License

public static Paragraph filterDescription(String text) {
    Paragraph para = new Paragraph(text);
    para.setFont(new Font(Font.HELVETICA, HEADER3_FONT_SIZE, Font.NORMAL, Color.BLACK));
    return para;//ww  w .j a  v  a2  s.  c  om
}

From source file:org.activityinfo.server.report.renderer.itext.ThemeHelper.java

License:Open Source License

public static Cell columnHeaderCell(String label, boolean leaf, int hAlign) throws BadElementException {
    Paragraph para = new Paragraph(label);
    para.setFont(new Font(Font.HELVETICA, BODY_FONT_SIZE, Font.NORMAL, Color.WHITE));

    Cell cell = new Cell();
    cell.addElement(para);//from ww  w  .j av  a  2s.  co  m
    cell.setHorizontalAlignment(hAlign);
    cell.setHeader(true);
    cell.setVerticalAlignment(Cell.ALIGN_BOTTOM);
    cell.setBackgroundColor(BLUE3);

    cell.setBorderWidth(0);

    return cell;
}

From source file:org.activityinfo.server.report.renderer.itext.ThemeHelper.java

License:Open Source License

private static Font bodyFont() {
    return new Font(Font.HELVETICA, BODY_FONT_SIZE, Font.NORMAL, Color.BLACK);
}

From source file:org.goodoldai.jeff.report.pdf.PDFReportBuilder.java

License:Open Source License

/**
 * This method inserts the header into the PDF report. The header consists 
 * of general data collected from the explanation (date and time created, 
 * owner, title, language and country). If any of this data is missing, it is not
 * inserted into the report. Since the report format is PDF, the provided 
 * stream should be an instance of com.lowagie.text.Document.
 * //  ww  w . j ava  2s.  c  om
 * @param explanation explanation from which the header data is to be
 * collected
 * @param stream output stream that the header is supposed to be inserted
 * into
 * 
 * @throws org.goodoldai.jeff.explanation.ExplanationException if any of the arguments are
 * null or if the entered output stream type is not com.lowagie.text.Document
 */
protected void insertHeader(Explanation explanation, Object stream) {
    if (explanation == null) {
        throw new ExplanationException("The argument 'explanation' is mandatory, so it can not be null");
    }

    if (stream == null) {
        throw new ExplanationException("The argument 'stream' is mandatory, so it can not be null");
    }

    if (!(stream instanceof Document)) {
        throw new ExplanationException("The entered stream must be a com.lowagie.text.Document instance");
    }

    Document doc = (Document) stream;

    String owner = explanation.getOwner();
    String title = explanation.getTitle();

    doc.addCreator("JEFF (Java Explanation Facility Framework)");
    doc.addAuthor(owner + " [OWNER]");
    doc.addCreationDate();

    if (title != null) {
        try {
            Phrase p = new Phrase(title, new Font(Font.HELVETICA, 16));
            Paragraph pa = new Paragraph(p);
            pa.setSpacingBefore(10);
            pa.setSpacingAfter(30);
            pa.setAlignment(Element.ALIGN_CENTER);
            doc.add(pa);
        } catch (DocumentException ex) {
            throw new ExplanationException(ex.getMessage());
        }
    }

}