GemBox.Document
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    HeaderFooter Class

    Namespace:
    GemBox.Document
    Assembly:
    GemBox.Document.dll

    Represent a header / footer for the parent Section.

    • C#
    • VB.NET
    public sealed class HeaderFooter : Element, IContentElement
    Public NotInheritable Class HeaderFooter
        Inherits Element
        Implements IContentElement
    Inheritance:
    System.Object
    Element
    HeaderFooter
    Implements
    IContentElement
    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.

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    public BlockCollection Blocks { get; }
    Public ReadOnly Property Blocks As BlockCollection
    Property Value
    BlockCollection

    The header / footer content.

    Remarks

    Supports Paragraph and Table elements.

    ElementType

    Gets the ElementType of this Element instance.

    • C#
    • VB.NET
    public override ElementType ElementType { get; }
    Public Overrides ReadOnly Property ElementType As ElementType
    Property Value
    ElementType

    The ElementType of this Element instance.

    Overrides
    Element.ElementType

    HeaderFooterType

    Gets the type of the header / footer.

    • C#
    • VB.NET
    public HeaderFooterType HeaderFooterType { get; }
    Public ReadOnly Property HeaderFooterType As HeaderFooterType
    Property Value
    HeaderFooterType

    The type of the header / footer.

    IsHeader

    Gets a value indicating whether this instance is header.

    • C#
    • VB.NET
    public bool IsHeader { get; }
    Public ReadOnly Property IsHeader As Boolean
    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.

    • C#
    • VB.NET
    public Section Parent { get; }
    Public ReadOnly Property Parent As Section
    Property Value
    Section

    The parent Section of this HeaderFooter instance.

    ParentCollection

    Gets the HeaderFooterCollection that contains this HeaderFooter instance.

    • C#
    • VB.NET
    public HeaderFooterCollection ParentCollection { get; }
    Public ReadOnly Property ParentCollection As HeaderFooterCollection
    Property Value
    HeaderFooterCollection

    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.

    • C#
    • VB.NET
    public Watermark Watermark { get; set; }
    Public Property Watermark As Watermark
    Property Value
    Watermark

    The watermark for this HeaderFooter.

    Methods

    Clone(HeaderFooterType)

    Clones this HeaderFooter instance and sets new HeaderFooterType.

    • C#
    • VB.NET
    public HeaderFooter Clone(HeaderFooterType newType)
    Public Function Clone(newType As HeaderFooterType) As HeaderFooter
    Parameters
    newType
    HeaderFooterType

    The new header/footer type.

    Returns
    HeaderFooter

    Cloned HeaderFooter.

    Clone(Boolean)

    Clones this HeaderFooter instance.

    • C#
    • VB.NET
    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
    HeaderFooter

    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)

    Implements

    IContentElement

    See Also

    HeadersFooters
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.