com.lowagie.text.rtf.text

Class RtfTab

public class RtfTab extends RtfAddableElement

The RtfTab encapsulates a tab position and tab type in a paragraph. To add tabs to a paragraph construct new RtfTab objects with the desired tab position and alignment and then add them to the paragraph. In the actual text the tabs are then defined as standard \t characters.

RtfTab tab = new RtfTab(300, RtfTab.TAB_LEFT_ALIGN);
Paragraph para = new Paragraph();
para.add(tab);
para.add("This paragraph has a\ttab defined.");

Version: $Id: RtfTab.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
intposition
The tab position in twips.
inttype
The tab alignment.
static intTAB_CENTER_ALIGN
A tab where the text is centre aligned.
static intTAB_DECIMAL_ALIGN
A tab where the text is aligned on the decimal character.
static intTAB_LEFT_ALIGN
A tab where the text is left aligned.
static intTAB_RIGHT_ALIGN
A tab where the text is right aligned.
Constructor Summary
RtfTab(float position, int type)
Constructs a new RtfTab with the given position and type.
Method Summary
byte[]write()
Writes the tab settings.
voidwriteContent(OutputStream result)
Writes the tab settings.

Field Detail

position

private int position
The tab position in twips.

type

private int type
The tab alignment.

TAB_CENTER_ALIGN

public static final int TAB_CENTER_ALIGN
A tab where the text is centre aligned.

TAB_DECIMAL_ALIGN

public static final int TAB_DECIMAL_ALIGN
A tab where the text is aligned on the decimal character. Which character that is depends on the language settings of the viewer.

TAB_LEFT_ALIGN

public static final int TAB_LEFT_ALIGN
A tab where the text is left aligned.

TAB_RIGHT_ALIGN

public static final int TAB_RIGHT_ALIGN
A tab where the text is right aligned.

Constructor Detail

RtfTab

public RtfTab(float position, int type)
Constructs a new RtfTab with the given position and type. The position is in standard iText points. The type is one of the tab alignment constants defined in the RtfTab.

Parameters: position The position of the tab in points. type The tab type constant.

Method Detail

write

public byte[] write()

Deprecated: replaced by writeContent

Writes the tab settings.

writeContent

public void writeContent(OutputStream result)
Writes the tab settings.