HeaderFooter Class
Represent a header / footer for the parent Section.
public sealed class HeaderFooter : Element, IContentElement
Public NotInheritable Class HeaderFooter
Inherits Element
Implements IContentElement
- Inheritance:
- System.ObjectHeaderFooter
Implements
Remarks
HeaderFooter is a special document content element that is not a part of a main document content, instead, it is repeated at the beginning (if IsHeader is true) or at the end of every page (first page, even pages or all pages) that is showing the parent Section's content.
HeaderFooter is a content element containing of Block derived elements that can be accessed through Blocks property. For more information, see GemBox.Document Content Model.
For more information about headers and footers, see header / footer example.
Constructors
HeaderFooter(DocumentModel, HeaderFooterType)
Initializes a new instance of the HeaderFooter class.
public HeaderFooter(DocumentModel document, HeaderFooterType headerFooterType)
Public Sub New(document As DocumentModel, headerFooterType As HeaderFooterType)
Parameters
document
- DocumentModel
The owner document.
headerFooterType
- HeaderFooterType
Type of the header / footer.
HeaderFooter(DocumentModel, HeaderFooterType, Block[])
Initializes a new instance of the HeaderFooter class.
public HeaderFooter(DocumentModel document, HeaderFooterType headerFooterType, params Block[] items)
Public Sub New(document As DocumentModel, headerFooterType As HeaderFooterType, ParamArray items As Block())
Parameters
document
- DocumentModel
The owner document.
headerFooterType
- HeaderFooterType
Type of the header / footer.
items
- Block[]
The header / footer content.
HeaderFooter(DocumentModel, HeaderFooterType, IEnumerable<Block>)
Initializes a new instance of the HeaderFooter class.
public HeaderFooter(DocumentModel document, HeaderFooterType headerFooterType, IEnumerable<Block> items)
Public Sub New(document As DocumentModel, headerFooterType As HeaderFooterType, items As IEnumerable(Of Block))
Parameters
document
- DocumentModel
The owner document.
headerFooterType
- HeaderFooterType
Type of the header / footer.
items
- System.Collections.Generic.IEnumerable<Block>
The header / footer content.
Properties
Blocks
Gets the header / footer content.
Property Value
The header / footer content.
Remarks
ElementType
Gets the ElementType of this Element instance.
public override ElementType ElementType { get; }
Public Overrides ReadOnly Property ElementType As ElementType
Property Value
The ElementType of this Element instance.
Overrides
HeaderFooterType
Gets the type of the header / footer.
public HeaderFooterType HeaderFooterType { get; }
Public ReadOnly Property HeaderFooterType As HeaderFooterType
Property Value
The type of the header / footer.
IsHeader
Gets a value indicating whether this instance is header.
Property Value
- System.Boolean
true if this instance represents header; false if this instance represents footer.
Parent
Gets the parent Section of this HeaderFooter instance.
Property Value
The parent Section of this HeaderFooter instance.
ParentCollection
Gets the HeaderFooterCollection that contains this HeaderFooter instance.
public HeaderFooterCollection ParentCollection { get; }
Public ReadOnly Property ParentCollection As HeaderFooterCollection
Property Value
The HeaderFooterCollection that contains this HeaderFooter instance.
Watermark
Gets or sets the watermark for this HeaderFooter. Setting the property to null removes the existing watermark.
Property Value
The watermark for this HeaderFooter.
Methods
Clone(HeaderFooterType)
Clones this HeaderFooter instance and sets new HeaderFooterType.
public HeaderFooter Clone(HeaderFooterType newType)
Public Function Clone(newType As HeaderFooterType) As HeaderFooter
Parameters
newType
- HeaderFooterType
The new header/footer type.
Returns
Cloned HeaderFooter.
Clone(Boolean)
Clones this HeaderFooter instance.
public HeaderFooter Clone(bool cloneDescendants)
Public Function Clone(cloneDescendants As Boolean) As HeaderFooter
Parameters
cloneDescendants
- System.Boolean
If set to true clone all descendants recursively; otherwise clone only current HeaderFooter.
Returns
Cloned HeaderFooter.
Remarks
Document content element instance can exist only in a one place in the document.
If you want to insert document content element into some other part of the same document, then clone the element and insert its clone.
If you want to insert document content element into another document, then you should first import it into another document with Import<T>(T, Boolean, Boolean) method and then insert the imported element.
For more information, see cloning example.
Inherited Properties
Content | Gets the content of the current Element. (Inherited from Element) |
Document | Gets the owner document. (Inherited from Element) |
Inherited Methods
GetChildElements(System.Boolean) | Gets the child elements. (Inherited from Element) |
GetChildElements(System.Boolean, ElementType[]) | Gets the child elements filtered by ElementType. (Inherited from Element) |
GetParentElements() | Gets the parent elements. (Inherited from Element) |
GetParentElements(ElementType[]) | Gets the parent elements. (Inherited from Element) |