com.lowagie.text.rtf.text

Class RtfChunk

public class RtfChunk extends RtfElement

The RtfChunk contains one piece of text. The smallest text element available in iText.

Version: $Id: RtfChunk.java 2784 2007-05-24 15:43:40Z hallm $

Author: Mark Hall (mhall@edu.uni-klu.ac.at) Thomas Bickel (tmb99@inode.at)

Field Summary
RtfColorbackground
An optional background colour.
Stringcontent
The actual content of this RtfChunk
RtfFontfont
The font of this RtfChunk
static byte[]FONT_END_SUPER_SUBSCRIPT
Constant for the end of sub / superscript flag
static byte[]FONT_SUBSCRIPT
Constant for the subscript flag
static byte[]FONT_SUPERSCRIPT
Constant for the superscript flag
static byte[]HIGHLIGHT
Constant for background colour.
booleansoftLineBreaks
Whether to use soft line breaks instead of hard ones.
floatsuperSubScript
The super / subscript of this RtfChunk
Constructor Summary
RtfChunk(RtfDocument doc, Chunk chunk)
Constructs a RtfChunk based on the content of a Chunk
Method Summary
booleangetSoftLineBreaks()
Gets whether to use soft line breaks instead of default hard ones.
voidsetRtfDocument(RtfDocument doc)
Sets the RtfDocument this RtfChunk belongs to.
voidsetSoftLineBreaks(boolean softLineBreaks)
Sets whether to use soft line breaks instead of default hard ones.
byte[]write()
Writes the content of this RtfChunk.
voidwriteContent(OutputStream result)
Writes the content of this RtfChunk.

Field Detail

background

private RtfColor background
An optional background colour.

content

private String content
The actual content of this RtfChunk

font

private RtfFont font
The font of this RtfChunk

FONT_END_SUPER_SUBSCRIPT

private static final byte[] FONT_END_SUPER_SUBSCRIPT
Constant for the end of sub / superscript flag

FONT_SUBSCRIPT

private static final byte[] FONT_SUBSCRIPT
Constant for the subscript flag

FONT_SUPERSCRIPT

private static final byte[] FONT_SUPERSCRIPT
Constant for the superscript flag

HIGHLIGHT

private static final byte[] HIGHLIGHT
Constant for background colour.

softLineBreaks

private boolean softLineBreaks
Whether to use soft line breaks instead of hard ones.

superSubScript

private float superSubScript
The super / subscript of this RtfChunk

Constructor Detail

RtfChunk

public RtfChunk(RtfDocument doc, Chunk chunk)
Constructs a RtfChunk based on the content of a Chunk

Parameters: doc The RtfDocument that this Chunk belongs to chunk The Chunk that this RtfChunk is based on

Method Detail

getSoftLineBreaks

public boolean getSoftLineBreaks()
Gets whether to use soft line breaks instead of default hard ones.

Returns: whether to use soft line breaks instead of default hard ones.

setRtfDocument

public void setRtfDocument(RtfDocument doc)
Sets the RtfDocument this RtfChunk belongs to.

Parameters: doc The RtfDocument to use

setSoftLineBreaks

public void setSoftLineBreaks(boolean softLineBreaks)
Sets whether to use soft line breaks instead of default hard ones.

Parameters: softLineBreaks whether to use soft line breaks instead of default hard ones.

write

public byte[] write()

Deprecated: replaced by writeContent

Writes the content of this RtfChunk. First the font information is written, then the content, and then more font information

Returns: A byte array with the content of this RtfChunk

writeContent

public void writeContent(OutputStream result)
Writes the content of this RtfChunk. First the font information is written, then the content, and then more font information