Example usage for com.lowagie.text.rtf.headerfooter RtfHeaderFooterGroup setHeaderFooter

List of usage examples for com.lowagie.text.rtf.headerfooter RtfHeaderFooterGroup setHeaderFooter

Introduction

In this page you can find the example usage for com.lowagie.text.rtf.headerfooter RtfHeaderFooterGroup setHeaderFooter.

Prototype

public void setHeaderFooter(HeaderFooter headerFooter, int displayAt) 

Source Link

Document

Set a HeaderFooter to be displayed at a certain position

Usage

From source file:net.sf.eclipsecs.ui.stats.export.internal.RTFStatsExporter.java

License:Open Source License

private void createHeaderAndFooter(Document doc) {
    Paragraph p = new Paragraph("Checkstyle statistics", pageHeaderAndFooterFont);
    p.setAlignment(Element.ALIGN_CENTER);
    HeaderFooter header = new RtfHeaderFooter(p);
    doc.setHeader(header);//from w  w  w  . j a va2  s  .  c  o  m

    SimpleDateFormat simpleDateFormat = new SimpleDateFormat();
    p = new Paragraph("Gnr le : " + simpleDateFormat.format(new Date()), pageHeaderAndFooterFont);
    p.setAlignment(Element.ALIGN_CENTER);
    RtfHeaderFooterGroup footer = new RtfHeaderFooterGroup();
    footer.setHeaderFooter(new RtfHeaderFooter(p),
            com.lowagie.text.rtf.headerfooter.RtfHeaderFooter.DISPLAY_ALL_PAGES);
    doc.setFooter(footer);
}

From source file:ro.nextreports.engine.exporter.RtfExporter.java

License:Apache License

private void buildFooter() throws DocumentException, QueryException {
    footer = buildRtfTable(PRINT_PAGE_FOOTER);
    if (footer == null) {
        return;/* ww w .j a v a 2  s . c om*/
    }
    printPageFooterBand();
    RtfHeaderFooterGroup footerGroup = new RtfHeaderFooterGroup();
    RtfHeaderFooter hf = new RtfHeaderFooter(footer);
    footerGroup.setHeaderFooter(hf, RtfHeaderFooter.DISPLAY_ALL_PAGES);
    document.setFooter(footerGroup);
}