com.lowagie.text.rtf.document

Class RtfDocumentHeader

public class RtfDocumentHeader extends RtfElement

The RtfDocumentHeader contains all classes required for the generation of the document header area.

Version: $Version:$

Author: Mark Hall (mhall@edu.uni-klu.ac.at)

Field Summary
RtfCodePagecodePage
The code page to use
RtfColorListcolorList
Stores all the colors used in the document
RtfFontListfontList
Stores all the fonts used in the document
HeaderFooterfooter
The current RtfHeaderFooterGroup for the footer
static byte[]FACING_PAGES
Constant for facing pages
HeaderFooterheader
The current RtfHeaderFooterGroup for the header
RtfInfoGroupinfoGroup
The information group with author/subject/keywords/title/producer/creationdate data
RtfListTablelistTable
Manages List tables
RtfPageSettingpageSetting
The page settings
RtfStylesheetListstylesheetList
Stores all paragraph styles used in the document.
static byte[]TITLE_PAGE
Constant for the title page
Constructor Summary
protected RtfDocumentHeader(RtfDocument doc)
Constructs a RtfDocumentHeader for a RtfDocument
Method Summary
voidaddInfoElement(RtfInfoElement rtfInfoElement)
Adds an RtfInfoElement to the list of RtfInfoElements
RtfHeaderFooterGroupconvertHeaderFooter(HeaderFooter hf, int type)
Converts a HeaderFooter into a RtfHeaderFooterGroup.
voidfreeListNumber(RtfList list)
Removes a RtfList from the list table
intgetColorNumber(RtfColor color)
Gets the number of the specified RtfColor
intgetFontNumber(RtfFont font)
Gets the number of the specified RtfFont
intgetListNumber(RtfList list)
Gets the number of the specified RtfList
RtfPageSettinggetPageSetting()
Gets the RtfPageSetting object of this RtfDocument
RtfParagraphStylegetRtfParagraphStyle(String styleName)
Gets the RtfParagraphStyle with the given style name.
protected voidinit()
Initialises the RtfDocumentHeader.
voidregisterParagraphStyle(RtfParagraphStyle rtfParagraphStyle)
Registers the RtfParagraphStyle for further use in the document.
voidsetFooter(HeaderFooter footer)
Sets the current footer to use
voidsetHeader(HeaderFooter header)
Sets the current header to use
byte[]write()
Write the contents of the document header area.
byte[]writeSectionDefinition()
Writes the section definition data

Field Detail

codePage

private RtfCodePage codePage
The code page to use

colorList

private RtfColorList colorList
Stores all the colors used in the document

fontList

private RtfFontList fontList
Stores all the fonts used in the document

footer

private HeaderFooter footer
The current RtfHeaderFooterGroup for the footer

FACING_PAGES

private static final byte[] FACING_PAGES
Constant for facing pages

header

private HeaderFooter header
The current RtfHeaderFooterGroup for the header

infoGroup

private RtfInfoGroup infoGroup
The information group with author/subject/keywords/title/producer/creationdate data

listTable

private RtfListTable listTable
Manages List tables

pageSetting

private RtfPageSetting pageSetting
The page settings

stylesheetList

private RtfStylesheetList stylesheetList
Stores all paragraph styles used in the document.

TITLE_PAGE

private static final byte[] TITLE_PAGE
Constant for the title page

Constructor Detail

RtfDocumentHeader

protected RtfDocumentHeader(RtfDocument doc)
Constructs a RtfDocumentHeader for a RtfDocument

Parameters: doc The RtfDocument this RtfDocumentHeader belongs to

Method Detail

addInfoElement

public void addInfoElement(RtfInfoElement rtfInfoElement)
Adds an RtfInfoElement to the list of RtfInfoElements

Parameters: rtfInfoElement The RtfInfoElement to add

convertHeaderFooter

private RtfHeaderFooterGroup convertHeaderFooter(HeaderFooter hf, int type)
Converts a HeaderFooter into a RtfHeaderFooterGroup. Depending on which class the HeaderFooter is, the correct RtfHeaderFooterGroup is created.

Parameters: hf The HeaderFooter to convert. type Whether the conversion is being done on a footer or header

Returns: The converted RtfHeaderFooterGroup.

See Also: RtfHeaderFooter RtfHeaderFooterGroup

freeListNumber

public void freeListNumber(RtfList list)
Removes a RtfList from the list table

Parameters: list The RtfList to remove

getColorNumber

public int getColorNumber(RtfColor color)
Gets the number of the specified RtfColor

Parameters: color The RtfColor for which to get the number

Returns: The number of the color

getFontNumber

public int getFontNumber(RtfFont font)
Gets the number of the specified RtfFont

Parameters: font The RtfFont for which to get the number

Returns: The number of the font

getListNumber

public int getListNumber(RtfList list)
Gets the number of the specified RtfList

Parameters: list The RtfList for which to get the number

Returns: The number of the list

getPageSetting

public RtfPageSetting getPageSetting()
Gets the RtfPageSetting object of this RtfDocument

Returns: The RtfPageSetting object

getRtfParagraphStyle

public RtfParagraphStyle getRtfParagraphStyle(String styleName)
Gets the RtfParagraphStyle with the given style name.

Parameters: styleName The style name of the RtfParagraphStyle to get.

Returns: The RtfParagraphStyle with the given style name or null.

init

protected void init()
Initialises the RtfDocumentHeader.

registerParagraphStyle

public void registerParagraphStyle(RtfParagraphStyle rtfParagraphStyle)
Registers the RtfParagraphStyle for further use in the document.

Parameters: rtfParagraphStyle The RtfParagraphStyle to register.

setFooter

public void setFooter(HeaderFooter footer)
Sets the current footer to use

Parameters: footer The HeaderFooter to use as footer

setHeader

public void setHeader(HeaderFooter header)
Sets the current header to use

Parameters: header The HeaderFooter to use as header

write

public byte[] write()
Write the contents of the document header area.

Returns: A byte array with the contents of the document header area

writeSectionDefinition

public byte[] writeSectionDefinition()
Writes the section definition data

Returns: A byte array with the section definition data