Search in sources :

Example 1 with HeaderFooter

use of com.lowagie.text.HeaderFooter in project dhis2-core by dhis2.

the class PdfDataEntryFormUtil method setFooterOnDocument.

// -------------------------------------------------------------------------
// METHODS
// -------------------------------------------------------------------------
public static void setFooterOnDocument(Document document, String footerText, Font font) {
    boolean isNumbered = true;
    HeaderFooter footer = new HeaderFooter(new Phrase(footerText, font), isNumbered);
    footer.setBorder(Rectangle.NO_BORDER);
    footer.setAlignment(Element.ALIGN_RIGHT);
    document.setFooter(footer);
}
Also used : HeaderFooter(com.lowagie.text.HeaderFooter) Phrase(com.lowagie.text.Phrase)

Example 2 with HeaderFooter

use of com.lowagie.text.HeaderFooter in project drools by kiegroup.

the class EndPage method createFooter.

public static HeaderFooter createFooter(String packageName) {
    HeaderFooter footer = new HeaderFooter(new Phrase(packageName + "-", HEADER_FOOTER_TEXT), true);
    footer.setBorder(1);
    footer.setAlignment(Element.ALIGN_RIGHT);
    return footer;
}
Also used : HeaderFooter(com.lowagie.text.HeaderFooter) Phrase(com.lowagie.text.Phrase)

Example 3 with HeaderFooter

use of com.lowagie.text.HeaderFooter in project vcell by virtualcell.

the class RTFWriter method writeHeaderFooter.

protected void writeHeaderFooter(String headerStr) throws DocumentException {
    if (headerStr.trim().length() > 0) {
        HeaderFooter headerFooter = new HeaderFooter(new Phrase(headerStr), false);
        document.setHeader(headerFooter);
    }
    HeaderFooter headerFooter = new HeaderFooter(new Phrase("Page "), true);
    document.setFooter(headerFooter);
}
Also used : HeaderFooter(com.lowagie.text.HeaderFooter) Phrase(com.lowagie.text.Phrase)

Example 4 with HeaderFooter

use of com.lowagie.text.HeaderFooter in project vcell by virtualcell.

the class PDFWriter method writeHeaderFooter.

protected void writeHeaderFooter(String headerStr) throws DocumentException {
    /*Paragraph headerParagraph = new Paragraph(headerStr);
	headerParagraph.add(" (produced by ");
	com.lowagie.text.Anchor vcLink = new com.lowagie.text.Anchor("The Virtual Cell");
	vcLink.setReference("http://www.nrcam.uchc.edu");
	headerParagraph.add(vcLink);
	headerParagraph.add(")");
	*/
    if (headerStr.trim().length() > 0) {
        HeaderFooter headerFooter = new HeaderFooter(new Phrase(headerStr), false);
        headerFooter.setBorder(Rectangle.BOTTOM);
        document.setHeader(headerFooter);
    }
    HeaderFooter headerFooter = new HeaderFooter(new Phrase("Page "), true);
    headerFooter.setBorder(Rectangle.TOP);
    document.setFooter(headerFooter);
}
Also used : HeaderFooter(com.lowagie.text.HeaderFooter) Phrase(com.lowagie.text.Phrase)

Example 5 with HeaderFooter

use of com.lowagie.text.HeaderFooter in project drools by kiegroup.

the class DroolsDocsBuilder method writePDF.

public void writePDF(OutputStream out) {
    // TODO: Use i18n!
    Document document = new Document();
    try {
        PdfWriter.getInstance(document, out);
        HeaderFooter footer = DroolsDocsComponentFactory.createFooter(packageData.getName());
        document.setFooter(footer);
        document.addTitle(packageData.getName().toUpperCase());
        document.open();
        // First page, documentation info.
        DroolsDocsComponentFactory.createFirstPage(document, currentDate, packageData);
        document.newPage();
        // List index of the rules
        document.add(new Phrase("Table of Contents"));
        document.add(DroolsDocsComponentFactory.createContents(packageData.getRules()));
        document.newPage();
        for (DrlRuleParser ruleData : packageData.getRules()) {
            DroolsDocsComponentFactory.newRulePage(document, packageData.getName(), ruleData);
        }
    } catch (DocumentException de) {
        System.err.println(de.getMessage());
    }
    document.close();
}
Also used : DocumentException(com.lowagie.text.DocumentException) HeaderFooter(com.lowagie.text.HeaderFooter) Phrase(com.lowagie.text.Phrase) Document(com.lowagie.text.Document) DrlRuleParser(org.drools.verifier.misc.DrlRuleParser)

Aggregations

HeaderFooter (com.lowagie.text.HeaderFooter)7 Phrase (com.lowagie.text.Phrase)7 Document (com.lowagie.text.Document)3 DocumentException (com.lowagie.text.DocumentException)3 Font (com.lowagie.text.Font)2 Paragraph (com.lowagie.text.Paragraph)2 Color (java.awt.Color)2 ServletOutputStream (javax.servlet.ServletOutputStream)2 DiscrepancyNoteBean (org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean)2 DiscrepancyNoteThread (org.akaza.openclinica.service.DiscrepancyNoteThread)1 DrlRuleParser (org.drools.verifier.misc.DrlRuleParser)1