Package com.lowagie.text.rtf.text
Class RtfChunk
- java.lang.Object
-
- com.lowagie.text.rtf.RtfElement
-
- com.lowagie.text.rtf.text.RtfChunk
-
- All Implemented Interfaces:
RtfBasicElement,RtfElementInterface
public class RtfChunk extends RtfElement
The RtfChunk contains one piece of text. The smallest text element available in iText.- Version:
- $Id: RtfChunk.java 3580 2008-08-06 15:52:00Z howard_s $
- Author:
- Mark Hall (Mark.Hall@mail.room3b.eu), Thomas Bickel (tmb99@inode.at)
-
-
Field Summary
Fields Modifier and Type Field Description private RtfColorbackgroundAn optional background color.private static byte[]BACKGROUND_COLORConstant for background color.private java.lang.StringcontentThe actual content of this RtfChunkprivate RtfFontfontThe font of this RtfChunkprivate static byte[]FONT_END_SUPER_SUBSCRIPTConstant for the end of sub / superscript flagprivate static byte[]FONT_SUBSCRIPTConstant for the subscript flagprivate static byte[]FONT_SUPERSCRIPTConstant for the superscript flagprivate booleansoftLineBreaksWhether to use soft line breaks instead of hard ones.private floatsuperSubScriptThe super / subscript of this RtfChunk-
Fields inherited from class com.lowagie.text.rtf.RtfElement
document, inHeader, inTable
-
Fields inherited from interface com.lowagie.text.rtf.RtfBasicElement
CLOSE_GROUP, COMMA_DELIMITER, DELIMITER, OPEN_GROUP, TWIPS_FACTOR
-
-
Constructor Summary
Constructors Constructor Description RtfChunk(RtfDocument doc, Chunk chunk)Constructs a RtfChunk based on the content of a Chunk
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.voidwriteContent(java.io.OutputStream result)Writes the content of this RtfChunk.-
Methods inherited from class com.lowagie.text.rtf.RtfElement
intToByteArray, isInTable, setInHeader, setInTable
-
-
-
-
Field Detail
-
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
-
FONT_END_SUPER_SUBSCRIPT
private static final byte[] FONT_END_SUPER_SUBSCRIPT
Constant for the end of sub / superscript flag
-
BACKGROUND_COLOR
private static final byte[] BACKGROUND_COLOR
Constant for background color.
-
font
private RtfFont font
The font of this RtfChunk
-
content
private java.lang.String content
The actual content of this RtfChunk
-
softLineBreaks
private boolean softLineBreaks
Whether to use soft line breaks instead of hard ones.
-
superSubScript
private float superSubScript
The super / subscript of this RtfChunk
-
background
private RtfColor background
An optional background color.
-
-
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 tochunk- The Chunk that this RtfChunk is based on
-
-
Method Detail
-
writeContent
public void writeContent(java.io.OutputStream result) throws java.io.IOExceptionWrites the content of this RtfChunk. First the font information is written, then the content, and then more font information- Specified by:
writeContentin interfaceRtfBasicElement- Specified by:
writeContentin classRtfElement- Parameters:
result- TheOutputStreamto write the content to- Throws:
java.io.IOException
-
setRtfDocument
public void setRtfDocument(RtfDocument doc)
Sets the RtfDocument this RtfChunk belongs to.- Specified by:
setRtfDocumentin interfaceRtfBasicElement- Overrides:
setRtfDocumentin classRtfElement- 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.
-
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.
-
-