Example usage for com.lowagie.text.rtf RtfElement writeContent

List of usage examples for com.lowagie.text.rtf RtfElement writeContent

Introduction

In this page you can find the example usage for com.lowagie.text.rtf RtfElement writeContent.

Prototype

public abstract void writeContent(final OutputStream out) throws IOException;

Source Link

Document

Writes the element content to the given output stream.

Usage

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
 *//* w w  w  . ja  v a  2s . c  o m*/
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);
}