use of com.lowagie.text.Paragraph in project vcell by virtualcell.
the class ITextWriter method createCell.
protected Cell createCell(String text, Font font, int colspan, int borderWidth, int alignment, boolean isHeader) throws DocumentException {
Cell cell = new Cell(new Paragraph(text, font));
cell.setBorderWidth(borderWidth);
cell.setHorizontalAlignment(alignment);
if (colspan > 1) {
cell.setColspan(colspan);
}
if (isHeader) {
cell.setHeader(true);
}
return (cell);
}
use of com.lowagie.text.Paragraph in project drools by kiegroup.
the class EndPage method newRulePage.
public static void newRulePage(Document document, String packageName, DrlRuleParser drlData) throws DocumentException {
document.add(new Paragraph(packageName, PACKAGE_NAME));
document.add(new Paragraph("Rule " + drlData.getName(), CHAPTER_TITLE));
// Extends
int index = drlData.getName().lastIndexOf("extends");
if (index > 0) {
document.add(new Paragraph("Extends:", BODY_TEXT));
Paragraph ext = new Paragraph(drlData.getName().substring("extends".length() + index), BODY_TEXT);
ext.setIndentationLeft(INDENTATION_LEFT);
document.add(ext);
}
// if the data came from guvnor, this will be empty
if (drlData.getDescription() != null && drlData.getDescription().trim().equals("")) {
Iterator<String> iter = drlData.getMetadata().iterator();
while (iter.hasNext()) {
String nextDesc = iter.next();
if (nextDesc.startsWith("Description")) {
String[] parts = splitFirst(nextDesc, ":");
// no description
if (parts.length == 1) {
// guvnor did not have it
document.add(newDescription(drlData.getDescription()));
} else {
document.add(newDescription(parts[1]));
}
}
}
} else {
document.add(newDescription(drlData.getDescription()));
}
// DRL
document.add(newRuleTable(drlData));
// Meta data
document.add(newTable("Metadata", drlData.getMetadata()));
// Other
createOtherItems(document, drlData.getOtherInformation());
document.newPage();
}
use of com.lowagie.text.Paragraph in project charts by vaadin.
the class PdfExportDemo method writePdfContent.
private void writePdfContent() throws DocumentException, IOException {
Paragraph caption = new Paragraph();
caption.add(new Chunk("Vaadin Charts Export Demo PDF", captionFont));
document.add(caption);
Paragraph br = new Paragraph(Chunk.NEWLINE);
document.add(br);
Paragraph paragraph = new Paragraph();
paragraph.add(new Chunk("This PDF is rendered with iText 2.1.7.", normalFont));
document.add(paragraph);
paragraph = new Paragraph();
paragraph.add(new Chunk("Chart below is originally an SVG image created with Vaadin Charts and rendered with help of Batik SVG Toolkit.", normalFont));
document.add(paragraph);
document.add(createSvgImage(writer.getDirectContent(), 400, 400));
document.add(createExampleTable());
}
Aggregations