## com.lowagie.text.rtf.headerfooter
Class RtfHeaderFooter

    java.lang.Object
      com.lowagie.text.Rectangle
          com.lowagie.text.HeaderFooter
              com.lowagie.text.rtf.headerfooter.RtfHeaderFooter

All Implemented Interfaces:
  Element, RtfBasicElement, RtfElementInterface

    public class RtfHeaderFooter

extends HeaderFooter
implements RtfBasicElement

The RtfHeaderFooter represents one header or footer. This class can be used directly.

Version:
  $Id$
Author:
  Mark Hall (Mark.Hall@mail.room3b.eu), Thomas Bickel (tmb99@inode.at)

Field Summary
`private java.lang.Object[]` `content` The content of this RtfHeaderFooter
`static int` `DISPLAY_ALL_PAGES` Constant for displaying the header/footer on all pages
`static int` `DISPLAY_FIRST_PAGE` Constant for displaying the header/footer on the first page
`static int` `DISPLAY_LEFT_PAGES` Constant for displaying the header/footer on all left hand pages
`static int` `DISPLAY_RIGHT_PAGES` Constant for displaying the header/footer on all right hand pages
`private int` `displayAt` The display location of this RtfHeaderFooter.
`private RtfDocument` `document` The RtfDocument this RtfHeaderFooter belongs to
`private static byte[]` `FOOTER_ALL` Constant for a footer on all pages
`private static byte[]` `FOOTER_FIRST` Constant for a footer on the first page
`private static byte[]` `FOOTER_LEFT` Constant for a footer on the left hand pages
`private static byte[]` `FOOTER_RIGHT` Constant for a footer on the right hand pages
`private static byte[]` `HEADER_ALL` Constant for a header on all pages
`private static byte[]` `HEADER_FIRST` Constant for a header on the first page
`private static byte[]` `HEADER_LEFT` Constant for a header on all left hand pages
`private static byte[]` `HEADER_RIGHT` Constant for a header on all right hand pages
`private int` `type` The display type of this RtfHeaderFooter.
`static int` `TYPE_FOOTER` Constant for the footer type
`static int` `TYPE_HEADER` Constant for the header type

Fields inherited from class com.lowagie.text.Rectangle
`backgroundColor, border, borderColor, borderColorBottom, borderColorLeft, borderColorRight, borderColorTop, borderWidth, borderWidthBottom, borderWidthLeft, borderWidthRight, borderWidthTop, BOTTOM, BOX, LEFT, llx, lly, NO_BORDER, RIGHT, rotation, TOP, UNDEFINED, urx, ury, useVariableBorders`

Fields inherited from interface com.lowagie.text.rtf.RtfBasicElement
`CLOSE_GROUP, COMMA_DELIMITER, DELIMITER, OPEN_GROUP, TWIPS_FACTOR`

Fields inherited from interface com.lowagie.text.Element

`ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LIST, LISTITEM, MARKED, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE, YMARK`

Constructor Summary
`` `RtfHeaderFooter(Element element)` Constructs a RtfHeaderFooter for any Element.
`` `RtfHeaderFooter(Element[] elements)` Constructs a RtfHeaderFooter for an array of Elements.
`protected` `RtfHeaderFooter(RtfDocument doc, HeaderFooter headerFooter)` Constructs a RtfHeaderFooter for a HeaderFooter.
`protected` `RtfHeaderFooter(RtfDocument doc, HeaderFooter headerFooter, int type, int displayAt)` Constructs a RtfHeaderFooter based on a HeaderFooter with a certain type and displayAt location.
`protected` `RtfHeaderFooter(RtfDocument doc, RtfHeaderFooter headerFooter, int displayAt)` Constructs a RtfHeaderFooter as a copy of an existing RtfHeaderFooter.

Method Summary
`private java.lang.Object[]` `getContent()` Gets the content of this RtfHeaderFooter
`void` `setAlignment(int alignment)` Set the alignment of this RtfHeaderFooter.
`void` `setDisplayAt(int displayAt)` Sets the display location of this RtfHeaderFooter
`void` `setInHeader(boolean inHeader)` Unused
`void` `setInTable(boolean inTable)` Unused
`void` `setRtfDocument(RtfDocument doc)` Sets the RtfDocument this RtfElement belongs to
`void` `setType(int type)` Sets the type of this RtfHeaderFooter
`void` `writeContent(java.io.OutputStream result)` Writes the content of this RtfHeaderFooter

Methods inherited from class com.lowagie.text.HeaderFooter
`alignment, getAfter, getBefore, isNumbered, paragraph, setPageNumber`

Methods inherited from class com.lowagie.text.Rectangle

`cloneNonPositionParameters, disableBorderSide, enableBorderSide, getBackgroundColor, getBorder, getBorderColor, getBorderColorBottom, getBorderColorLeft, getBorderColorRight, getBorderColorTop, getBorderWidth, getBorderWidthBottom, getBorderWidthLeft, getBorderWidthRight, getBorderWidthTop, getBottom, getBottom, getChunks, getGrayFill, getHeight, getLeft, getLeft, getRight, getRight, getRotation, getTop, getTop, getWidth, hasBorder, hasBorders, isContent, isNestable, isUseVariableBorders, normalize, process, rectangle, rotate, setBackgroundColor, setBorder, setBorderColor, setBorderColorBottom, setBorderColorLeft, setBorderColorRight, setBorderColorTop, setBorderWidth, setBorderWidthBottom, setBorderWidthLeft, setBorderWidthRight, setBorderWidthTop, setBottom, setGrayFill, setLeft, setRight, setTop, setUseVariableBorders, softCloneNonPositionParameters, toString, type`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### TYPE_HEADER

    public static final int TYPE_HEADER

  Constant for the header type

  See Also:
    Constant Field Values

### TYPE_FOOTER

    public static final int TYPE_FOOTER

  Constant for the footer type

  See Also:
    Constant Field Values

### DISPLAY_FIRST_PAGE

    public static final int DISPLAY_FIRST_PAGE

  Constant for displaying the header/footer on the first page

  See Also:
    Constant Field Values

### DISPLAY_ALL_PAGES

    public static final int DISPLAY_ALL_PAGES

  Constant for displaying the header/footer on all pages

  See Also:
    Constant Field Values

### DISPLAY_LEFT_PAGES

    public static final int DISPLAY_LEFT_PAGES

  Constant for displaying the header/footer on all left hand pages

  See Also:
    Constant Field Values

### DISPLAY_RIGHT_PAGES

    public static final int DISPLAY_RIGHT_PAGES

  Constant for displaying the header/footer on all right hand pages

  See Also:
    Constant Field Values

### HEADER_ALL

    private static final byte[] HEADER_ALL

  Constant for a header on all pages

### HEADER_FIRST

    private static final byte[] HEADER_FIRST

  Constant for a header on the first page

### HEADER_LEFT

    private static final byte[] HEADER_LEFT

  Constant for a header on all left hand pages

### HEADER_RIGHT

    private static final byte[] HEADER_RIGHT

  Constant for a header on all right hand pages

### FOOTER_ALL

    private static final byte[] FOOTER_ALL

  Constant for a footer on all pages

### FOOTER_FIRST

    private static final byte[] FOOTER_FIRST

  Constant for a footer on the first page

### FOOTER_LEFT

    private static final byte[] FOOTER_LEFT

  Constant for a footer on the left hand pages

### FOOTER_RIGHT

    private static final byte[] FOOTER_RIGHT

  Constant for a footer on the right hand pages

### document

    private RtfDocument document

  The RtfDocument this RtfHeaderFooter belongs to

### content

    private java.lang.Object[] content

  The content of this RtfHeaderFooter

### type

    private int type

  The display type of this RtfHeaderFooter. TYPE_HEADER or TYPE_FOOTER

### displayAt

    private int displayAt

  The display location of this RtfHeaderFooter. DISPLAY_FIRST_PAGE, DISPLAY_LEFT_PAGES, DISPLAY_RIGHT_PAGES or DISPLAY_ALL_PAGES

Constructor Detail

### RtfHeaderFooter

    protected RtfHeaderFooter(RtfDocument doc,
                              HeaderFooter headerFooter,
                              int type,
                              int displayAt)

  Constructs a RtfHeaderFooter based on a HeaderFooter with a certain type and displayAt location. For internal use only.

  Parameters:
    `doc` - The RtfDocument this RtfHeaderFooter belongs to
    `headerFooter` - The HeaderFooter to base this RtfHeaderFooter on
    `type` - The type of RtfHeaderFooter
    `displayAt` - The display location of this RtfHeaderFooter

### RtfHeaderFooter

    protected RtfHeaderFooter(RtfDocument doc,
                              RtfHeaderFooter headerFooter,
                              int displayAt)

  Constructs a RtfHeaderFooter as a copy of an existing RtfHeaderFooter. For internal use only.

  Parameters:
    `doc` - The RtfDocument this RtfHeaderFooter belongs to
    `headerFooter` - The RtfHeaderFooter to copy
    `displayAt` - The display location of this RtfHeaderFooter

### RtfHeaderFooter

    protected RtfHeaderFooter(RtfDocument doc,
                              HeaderFooter headerFooter)

  Constructs a RtfHeaderFooter for a HeaderFooter.

  Parameters:
    `doc` - The RtfDocument this RtfHeaderFooter belongs to
    `headerFooter` - The HeaderFooter to base this RtfHeaderFooter on

### RtfHeaderFooter

    public RtfHeaderFooter(Element element)

  Constructs a RtfHeaderFooter for any Element.

  Parameters:
    `element` - The Element to display as content of this RtfHeaderFooter

### RtfHeaderFooter

    public RtfHeaderFooter(Element[] elements)

  Constructs a RtfHeaderFooter for an array of Elements.

  Parameters:
    `elements` - The Elements to display as the content of this RtfHeaderFooter.

Method Detail

### setRtfDocument

    public void setRtfDocument(RtfDocument doc)

  Sets the RtfDocument this RtfElement belongs to

  Specified by:
    `setRtfDocument` in interface `RtfBasicElement`
  Parameters:
    `doc` - The RtfDocument to use

### writeContent

    public void writeContent(java.io.OutputStream result)
                      throws java.io.IOException

  Writes the content of this RtfHeaderFooter

  Specified by:
    `writeContent` in interface `RtfBasicElement`
  Parameters:
    `result` - The `OutputStream` to write the content to
  Throws:
    `java.io.IOException`

### setDisplayAt

    public void setDisplayAt(int displayAt)

  Sets the display location of this RtfHeaderFooter

  Parameters:
    `displayAt` - The display location to use.

### setType

    public void setType(int type)

  Sets the type of this RtfHeaderFooter

  Parameters:
    `type` - The type to use.

### getContent

    private java.lang.Object[] getContent()

  Gets the content of this RtfHeaderFooter

  Returns:
    The content of this RtfHeaderFooter

### setInTable

    public void setInTable(boolean inTable)

  Unused

  Specified by:
    `setInTable` in interface `RtfBasicElement`
  Parameters:
    `inTable` -

### setInHeader

    public void setInHeader(boolean inHeader)

  Unused

  Specified by:
    `setInHeader` in interface `RtfBasicElement`
  Parameters:
    `inHeader` -

### setAlignment

    public void setAlignment(int alignment)

  Set the alignment of this RtfHeaderFooter. Passes the setting on to the contained element.

  Overrides:
    `setAlignment` in class `HeaderFooter`
  Parameters:
    `alignment` - the new alignment

Hosted by Hostbasket