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