Package com.lowagie.text.rtf.document
Class RtfDocumentHeader
- java.lang.Object
-
- com.lowagie.text.rtf.RtfElement
-
- com.lowagie.text.rtf.document.RtfDocumentHeader
-
- All Implemented Interfaces:
RtfBasicElement
,com.lowagie.text.RtfElementInterface
public class RtfDocumentHeader extends RtfElement
The RtfDocumentHeader contains all classes required for the generation of the document header area.- Version:
- $Id: RtfDocumentHeader.java 3580 2008-08-06 15:52:00Z howard_s $
-
-
Field Summary
Fields Modifier and Type Field Description private RtfCodePage
codePage
The code page to useprivate RtfColorList
colorList
Stores all the colors used in the documentprivate static byte[]
FACING_PAGES
Constant for facing pagesprivate RtfFontList
fontList
Stores all the fonts used in the documentprivate com.lowagie.text.HeaderFooter
footer
The current RtfHeaderFooterGroup for the footerprivate RtfFootnoteSetting
footnoteSetting
Footnote settingsprivate RtfGenerator
generator
Generator string in documentprivate com.lowagie.text.HeaderFooter
header
The current RtfHeaderFooterGroup for the headerprivate RtfInfoGroup
infoGroup
The information group with author/subject/keywords/title/producer/creationdate dataprivate RtfListTable
listTable
Manages List tablesprivate RtfPageSetting
pageSetting
The page settingsprivate RtfProtectionSetting
protectionSetting
The protection settings Author: Howard Shank (hgshank@yahoo.com)private RtfStylesheetList
stylesheetList
Stores all paragraph styles used in the document.private static byte[]
TITLE_PAGE
Constant for the title page-
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 Modifier Constructor Description protected
RtfDocumentHeader(RtfDocument doc)
Constructs a RtfDocumentHeader for a RtfDocument
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addInfoElement(RtfInfoElement rtfInfoElement)
Adds an RtfInfoElement to the list of RtfInfoElementsprivate RtfHeaderFooterGroup
convertHeaderFooter(com.lowagie.text.HeaderFooter hf, int type)
Converts a HeaderFooter into a RtfHeaderFooterGroup.void
freeListNumber(RtfList list)
Removes a RtfList from the list tableint
getColorNumber(RtfColor color)
Gets the number of the specified RtfColorint
getFontNumber(RtfFont font)
Gets the number of the specified RtfFontint
getListNumber(RtfList list)
Gets the number of the specified RtfListRtfListTable
getListTable()
Get theRtfListTable
object.RtfPageSetting
getPageSetting()
Gets the RtfPageSetting object of this RtfDocumentRtfParagraphStyle
getRtfParagraphStyle(java.lang.String styleName)
Gets the RtfParagraphStyle with the given style name.protected void
init()
initializes the RtfDocumentHeader.void
registerParagraphStyle(RtfParagraphStyle rtfParagraphStyle)
Registers the RtfParagraphStyle for further use in the document.void
setFooter(com.lowagie.text.HeaderFooter footer)
Sets the current footer to usevoid
setHeader(com.lowagie.text.HeaderFooter header)
Sets the current header to usevoid
writeContent(java.io.OutputStream result)
Writes the contents of the document header area.void
writeSectionDefinition(java.io.OutputStream result)
Writes the section definition data-
Methods inherited from class com.lowagie.text.rtf.RtfElement
intToByteArray, isInTable, setInHeader, setInTable, setRtfDocument
-
-
-
-
Field Detail
-
TITLE_PAGE
private static final byte[] TITLE_PAGE
Constant for the title page
-
FACING_PAGES
private static final byte[] FACING_PAGES
Constant for facing pages
-
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
-
listTable
private RtfListTable listTable
Manages List tables
-
stylesheetList
private RtfStylesheetList stylesheetList
Stores all paragraph styles used in the document.
-
generator
private RtfGenerator generator
Generator string in document
-
infoGroup
private RtfInfoGroup infoGroup
The information group with author/subject/keywords/title/producer/creationdate data
-
protectionSetting
private RtfProtectionSetting protectionSetting
The protection settings Author: Howard Shank (hgshank@yahoo.com)- Since:
- 2.1.1
-
pageSetting
private RtfPageSetting pageSetting
The page settings
-
footnoteSetting
private RtfFootnoteSetting footnoteSetting
Footnote settings
-
header
private com.lowagie.text.HeaderFooter header
The current RtfHeaderFooterGroup for the header
-
footer
private com.lowagie.text.HeaderFooter footer
The current RtfHeaderFooterGroup for the footer
-
-
Constructor Detail
-
RtfDocumentHeader
protected RtfDocumentHeader(RtfDocument doc)
Constructs a RtfDocumentHeader for a RtfDocument- Parameters:
doc
- The RtfDocument this RtfDocumentHeader belongs to
-
-
Method Detail
-
init
protected void init()
initializes the RtfDocumentHeader.
-
writeContent
public void writeContent(java.io.OutputStream result) throws java.io.IOException
Writes the contents of the document header area.- Specified by:
writeContent
in interfaceRtfBasicElement
- Specified by:
writeContent
in classRtfElement
- Parameters:
result
- TheOutputStream
to write the content to- Throws:
java.io.IOException
-
writeSectionDefinition
public void writeSectionDefinition(java.io.OutputStream result)
Writes the section definition data- Parameters:
result
-
-
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
-
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
-
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
-
getRtfParagraphStyle
public RtfParagraphStyle getRtfParagraphStyle(java.lang.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.
-
freeListNumber
public void freeListNumber(RtfList list)
Removes a RtfList from the list table- Parameters:
list
- The RtfList to remove
-
getPageSetting
public RtfPageSetting getPageSetting()
Gets the RtfPageSetting object of this RtfDocument- Returns:
- The RtfPageSetting object
-
addInfoElement
public void addInfoElement(RtfInfoElement rtfInfoElement)
Adds an RtfInfoElement to the list of RtfInfoElements- Parameters:
rtfInfoElement
- The RtfInfoElement to add
-
setHeader
public void setHeader(com.lowagie.text.HeaderFooter header)
Sets the current header to use- Parameters:
header
- The HeaderFooter to use as header
-
setFooter
public void setFooter(com.lowagie.text.HeaderFooter footer)
Sets the current footer to use- Parameters:
footer
- The HeaderFooter to use as footer
-
registerParagraphStyle
public void registerParagraphStyle(RtfParagraphStyle rtfParagraphStyle)
Registers the RtfParagraphStyle for further use in the document.- Parameters:
rtfParagraphStyle
- The RtfParagraphStyle to register.
-
convertHeaderFooter
private RtfHeaderFooterGroup convertHeaderFooter(com.lowagie.text.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
-
getListTable
public RtfListTable getListTable()
Get theRtfListTable
object.- Returns:
- the ListTable object.
- Since:
- 2.1.3
-
-