Class HeaderFooter
- Namespace
- iTextSharp.text
- Assembly
- iTextSharp.LGPLv2.Core.dll
A HeaderFooter-object is a Rectangle with text that can be put above and/or below every page.
public class HeaderFooter : Rectangle, IElement
- Inheritance
-
HeaderFooter
- Implements
- Derived
- Inherited Members
Examples
HeaderFooter header = new HeaderFooter(new Phrase("This is a header."), false); HeaderFooter footer = new HeaderFooter(new Phrase("This is page "), new Phrase(".")); document.SetHeader(header); document.SetFooter(footer);
Constructors
HeaderFooter(Properties)
public HeaderFooter(Properties attributes)
Parameters
attributes
Properties
HeaderFooter(Phrase, bool)
Constructs a Header-object with a pagenumber at the end.
public HeaderFooter(Phrase before, bool numbered)
Parameters
HeaderFooter(Phrase, Phrase)
constructors
public HeaderFooter(Phrase before, Phrase after)
Parameters
Properties
After
methods
public Phrase After { get; set; }
Property Value
- Phrase
a Phrase
Alignment
Sets the Element.
public int Alignment { get; set; }
Property Value
- int
the new alignment
Before
Get/set the part that comes before the pageNumber.
public Phrase Before { get; set; }
Property Value
- Phrase
a Phrase
PageNumber
Sets the page number.
public int PageNumber { set; }
Property Value
- int
the new page number
Paragraph
Gets the Paragraph that can be used as header or footer.
public Paragraph Paragraph { get; }
Property Value
- Paragraph
a Paragraph
Methods
IsNumbered()
Checks if the HeaderFooter contains a page number.
public bool IsNumbered()
Returns
- bool
true if the page has to be numbered
SetAlignment(string)
Sets the alignment of this HeaderFooter.
public void SetAlignment(string alignment)
Parameters
alignment
stringthe new alignment as a string