HeaderFooter

Overview

HeaderFooter is a class in Aspose.PDF FOSS for .NET.

Represents a header or footer that can be applied to PDF pages.

This class provides 4 methods for working with HeaderFooter objects in .NET programs. Available methods include: ApplyAsFooter, ApplyAsHeader, Clone, FromText. All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package. Properties: HorizontalAlignment, IsClipExtraContent, Margin, Paragraphs, Text, TextState.

Properties

NameTypeAccessDescription
TextstringRead/WriteThe text content.
TextStateTextStateRead/WriteText formatting state (font, size, color).
MarginMarginInfoRead/WriteMargins controlling the position of the header/footer text.
HorizontalAlignmentHorizontalAlignmentRead/WriteHorizontal alignment of the text.
ParagraphsParagraphsRead/WriteCollection of paragraph objects (TextFragment, HtmlFragment, etc.) to render in the header/footer.
IsClipExtraContentboolRead/WriteWhether content overflowing the header/footer area is clipped.

Methods

SignatureDescription
FromText(text: string)Create a HeaderFooter from a text string.
Clone()Shallow clone — copies Text/TextState/ Margin/HorizontalAlignment plus shallow-copied references to every entry in Paragraphs.
ApplyAsHeader(pages: Page[], substitutePageNumbers: bool)Apply this header/footer as a header (positioned at the top) to the given pages.
ApplyAsFooter(pages: Page[], substitutePageNumbers: bool)Apply this header/footer as a footer (positioned at the bottom) to the given pages.

See Also