use of com.lowagie.text.Font in project activityinfo by bedatadriven.
the class ThemeHelper method legendTitle.
public static Paragraph legendTitle(String title) {
Paragraph para = new Paragraph(title);
para.setFont(new Font(Font.TIMES_ROMAN, BODY_FONT_SIZE, Font.BOLD, BLUE2));
para.setSpacingBefore(BODY_FONT_SIZE);
return para;
}
use of com.lowagie.text.Font in project activityinfo by bedatadriven.
the class ThemeHelper method reportTitle.
public static Paragraph reportTitle(String title) {
Paragraph para = new Paragraph(title);
para.setFont(new Font(Font.TIMES_ROMAN, TITLE_FONT_SIZE, Font.NORMAL, BLUE));
para.setSpacingAfter(15);
return para;
}
use of com.lowagie.text.Font in project activityinfo by bedatadriven.
the class ThemeHelper method bodyCell.
/**
* Renders a Cell for
*
* @param label
* @param header
* @param depth
* @param leaf
* @param horizantalAlignment
* @return
* @throws BadElementException
*/
public static Cell bodyCell(String label, boolean header, int depth, boolean leaf, int horizantalAlignment) throws BadElementException {
Cell cell = new Cell();
cell.setHorizontalAlignment(horizantalAlignment);
if (label != null) {
Paragraph para = new Paragraph(label);
Font font = bodyFont();
if (depth == 0 && !leaf) {
font.setColor(Color.WHITE);
}
para.setFont(font);
para.setIndentationLeft(LEFT_INDENT + (header ? HEADER3_FONT_SIZE * depth : 0));
cell.addElement(para);
}
cell.setBorderWidthLeft(0f);
cell.setBorderWidthRight(0);
cell.setBorderWidthTop(0);
if (!leaf && depth == 0) {
// #95B3D7
cell.setBackgroundColor(BLUE4);
cell.setBorderWidthBottom(THIN_BORDER_WIDTH);
// #DBE5F1
cell.setBorderColorBottom(BLUE5);
} else if (!leaf && depth == 1) {
cell.setBackgroundColor(BLUE5);
cell.setBorderWidthBottom(THIN_BORDER_WIDTH);
cell.setBorderColorBottom(BLUE2);
} else {
cell.setBorderWidthBottom(THIN_BORDER_WIDTH);
cell.setBorderColorBottom(BLUE5);
cell.setBorderWidthTop(THIN_BORDER_WIDTH);
cell.setBorderColorTop(BLUE5);
}
return cell;
}
use of com.lowagie.text.Font in project dhis2-core by dhis2.
the class PdfFormFontSettings method createFont.
private Font createFont(int fontType) {
Font font = new Font();
font.setFamily(FONTFAMILY);
switch(fontType) {
case FONTTYPE_BODY:
font.setSize(FONTSIZE_BODY);
font.setColor(Color.BLACK);
break;
case FONTTYPE_TITLE:
font.setSize(FONTSIZE_TITLE);
font.setStyle(java.awt.Font.BOLD);
// Navy Color
font.setColor(new Color(0, 0, 128));
break;
case FONTTYPE_DESCRIPTION:
font.setSize(FONTSIZE_DESCRIPTION);
font.setColor(Color.DARK_GRAY);
break;
case FONTTYPE_SECTIONHEADER:
font.setSize(FONTSIZE_SECTIONHEADER);
font.setStyle(java.awt.Font.BOLD);
// Steel Blue Color
font.setColor(new Color(70, 130, 180));
break;
case FONTTYPE_FOOTER:
font.setSize(FONTSIZE_FOOTER);
break;
default:
font.setSize(FONTSIZE_BODY);
break;
}
return font;
}
use of com.lowagie.text.Font in project OpenClinica by OpenClinica.
the class DownloadDiscrepancyNote method serializeThreadsToPDF.
public void serializeThreadsToPDF(List<DiscrepancyNoteThread> listOfThreads, OutputStream stream, String studyIdentifier) {
ServletOutputStream servletStream = (ServletOutputStream) stream;
Document pdfDoc = new Document();
try {
PdfWriter.getInstance(pdfDoc, servletStream);
pdfDoc.open();
// Create header for the study identifier or name
if (studyIdentifier != null) {
HeaderFooter header = new HeaderFooter(new Phrase("Study Identifier: " + studyIdentifier + " pg."), true);
header.setAlignment(Element.ALIGN_CENTER);
Paragraph para = new Paragraph("Study Identifier: " + studyIdentifier, new Font(Font.HELVETICA, 18, Font.BOLD, new Color(0, 0, 0)));
para.setAlignment(Element.ALIGN_CENTER);
pdfDoc.setHeader(header);
pdfDoc.add(para);
}
for (DiscrepancyNoteThread discNoteThread : listOfThreads) {
pdfDoc.add(this.createTableThreadHeader(discNoteThread));
// Just the parent of the thread? discNoteThread.getLinkedNoteList()
for (DiscrepancyNoteBean discNoteBean : discNoteThread.getLinkedNoteList()) {
// DiscrepancyNoteBean discNoteBean = discNoteThread.getLinkedNoteList().getFirst();
if (discNoteBean.getParentDnId() > 0) {
pdfDoc.add(this.createTableFromBean(discNoteBean));
pdfDoc.add(new Paragraph("\n"));
}
}
}
// pdfDoc.add(new Paragraph(content));
} catch (DocumentException e) {
e.printStackTrace();
}
pdfDoc.close();
}
Aggregations