Example usage for com.lowagie.text.rtf.text RtfParagraph PARAGRAPH

List of usage examples for com.lowagie.text.rtf.text RtfParagraph PARAGRAPH

Introduction

In this page you can find the example usage for com.lowagie.text.rtf.text RtfParagraph PARAGRAPH.

Prototype

null PARAGRAPH

To view the source code for com.lowagie.text.rtf.text RtfParagraph PARAGRAPH.

Click Source Link

Document

Constant for the end of a paragraph

Usage

From source file:org.pentaho.reporting.engine.classic.core.modules.output.table.rtf.itext.PatchRtfCell.java

License:Open Source License

/**
 * Write the content of this PatchRtfCell
 *///from  ww w . ja  v  a2  s. c  o m
public void writeContent(final OutputStream result) throws IOException {
    if (this.content.size() == 0) {
        result.write(RtfParagraph.PARAGRAPH_DEFAULTS);
        if (this.parentRow.getParentTable().getTableFitToPage()) {
            result.write(RtfParagraphStyle.KEEP_TOGETHER_WITH_NEXT);
        }
        result.write(RtfParagraph.IN_TABLE);
    } else {
        for (int i = 0; i < this.content.size(); i++) {
            RtfBasicElement rtfElement = this.content.get(i);
            if (rtfElement instanceof RtfParagraph) {
                ((RtfParagraph) rtfElement)
                        .setKeepTogetherWithNext(this.parentRow.getParentTable().getTableFitToPage());
            }
            rtfElement.writeContent(result);
            if (rtfElement instanceof RtfParagraph && i < (this.content.size() - 1)) {
                result.write(RtfParagraph.PARAGRAPH);
            }
        }
    }
    result.write(DocWriter.getISOBytes("\\cell"));
}

From source file:org.pentaho.reporting.engine.classic.core.modules.output.table.rtf.itext.PatchRtfTable.java

License:Open Source License

/**
 * Writes the content of this PatchRtfTable
 *///from w w w.  j  av  a 2  s .  c  om
public void writeContent(final OutputStream result) throws IOException {
    if (!inHeader) {
        if (this.offset != -1) {
            result.write(RtfFont.FONT_SIZE);
            result.write(intToByteArray(this.offset));
        }
        result.write(RtfParagraph.PARAGRAPH);
    }

    final Iterator<PatchRtfRow> iterator = this.rows.iterator();
    while (iterator.hasNext()) {
        final RtfElement re = iterator.next();
        re.writeContent(result);
        iterator.remove();
    }

    result.write(RtfParagraph.PARAGRAPH_DEFAULTS);
}