com.lowagie.text.rtf.direct

Class RtfDirectContent

public class RtfDirectContent extends RtfAddableElement

The RtfDirectContent makes it possible to directly add RTF code into an RTF document. This can be used to directly add RTF fragments that have been created with other RTF editors. One important aspect is that font and color numbers will not be modified. This means that the fonts and colors visible in the final document might not be equivalent with those set on the direct content.

For convenience the RtfDirectContent provides a DIRECT_SOFT_LINEBREAK constant that makes it possible to easily add soft line-breaks anywhere in the RTF document.

Version: $Id: RtfDirectContent.java 2776 2007-05-23 20:01:40Z hallm $

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

Field Summary
StringdirectContent
The direct content to add.
static RtfDirectContentDIRECT_SOFT_LINEBREAK
Add the DIRECT_SOFT_LINEBREAK to the Document to insert a soft line-break at that position.
Constructor Summary
RtfDirectContent(String directContent)
Constructs a new RtfDirectContent with the content to add.
Method Summary
byte[]write()
Writes the direct content.
voidwriteContent(OutputStream out)
Writes the element content to the given output stream.

Field Detail

directContent

private String directContent
The direct content to add.

DIRECT_SOFT_LINEBREAK

public static final RtfDirectContent DIRECT_SOFT_LINEBREAK
Add the DIRECT_SOFT_LINEBREAK to the Document to insert a soft line-break at that position.

Constructor Detail

RtfDirectContent

public RtfDirectContent(String directContent)
Constructs a new RtfDirectContent with the content to add.

Parameters: directContent The content to add.

Method Detail

write

public byte[] write()

Deprecated: replaced by writeContent

Writes the direct content.

writeContent

public void writeContent(OutputStream out)
Writes the element content to the given output stream.