New to Telerik Document ProcessingStart a free 30-day trial

Headers and Footers

Updated on Jun 12, 2026

Header and Footer elements are block containers in the RadWordsProcessing document model, so they can contain paragraphs and tables. Each Section exposes three header slots and three footer slots that let you define different content for the first page, even pages, and the default page flow.

Use this article to understand the available header and footer types, how section settings affect them, and how to create, retrieve, and reuse them in a flow document.

Available Types

Headers and footers are properties of a Section. Each section can define these header and footer types:

TypeDescription
DefaultUsed for the section pages unless a more specific first-page or even-page header or footer applies.
FirstUsed only on the first page of the section.
EvenUsed on even-numbered pages of the section when even and odd headers or footers are enabled.

The header or footer that appears on a page depends on both the content you assign and the section-level settings that enable specific variants:

  • RadFlowDocument.HasDifferentEvenOddPageHeadersFooters controls whether the Even header and footer are used for even-numbered document pages.
  • Section.HasDifferentFirstPageHeaderFooter controls whether the First header and footer are used on the first page of the section.
  • Section.HeaderTopMargin sets the top margin for the header area in device-independent pixels, where 96 pixels equal 1 inch.
  • Section.FooterBottomMargin sets the bottom margin for the footer area in device-independent pixels.

If the even and odd setting is false, the section ignores the Even header and footer. If the first-page setting is false, the section ignores the First header and footer.

Create headers and footers through the section properties for the required HeaderFooterType.

Use the following example to create a header:

Example: Create a header

C#
RadFlowDocument document = new RadFlowDocument();
Section section = document.Sections.AddSection();

document.Sections.First().Headers.Add(); // Creates the default Header.
document.Sections.First().Headers.Add(HeaderFooterType.First);
document.Sections.First().Headers.Add(HeaderFooterType.Even);

Use the following example to create a footer:

C#
RadFlowDocument document = new RadFlowDocument();
Section section = document.Sections.AddSection();

document.Sections.First().Footers.Add(); // Creates the default Footer.
document.Sections.First().Footers.Add(HeaderFooterType.First);
document.Sections.First().Footers.Add(HeaderFooterType.Even);

The Parent property of Header and Footer contains a reference to the Section from which the object is obtained.

Operating with Headers and Footers

You can access the headers and footers of a section through the Default, Even, and First properties of the section Headers and Footers collections.

The following example gets the default header of a section:

Example: Get the default header of a section

C#
Header defaultHeader = section.Headers.Default;

The following example gets the default footer of a section:

C#
Footer defaultFooter = section.Footers.Default;

If a header or footer of a given type is not added, the corresponding property value is null.

The following example adds different headers for odd and even pages:

Example: Add headers for even and odd pages

C#
RadFlowDocument document = new RadFlowDocument();
document.Sections.AddSection();
document.HasDifferentEvenOddPageHeadersFooters = true;

Header defaultHeader = document.Sections.First().Headers.Add();
Paragraph defaultHeaderParagraph = defaultHeader.Blocks.AddParagraph();
defaultHeaderParagraph.TextAlignment = Alignment.Right;
defaultHeaderParagraph.Inlines.AddRun("This is a sample odd page header.");

Header evenHeader = document.Sections.First().Headers.Add(HeaderFooterType.Even);
Paragraph evenHeaderParagraph = evenHeader.Blocks.AddParagraph();
evenHeaderParagraph.TextAlignment = Alignment.Left;
evenHeaderParagraph.Inlines.AddRun("This is a sample even page header.");

Linking Headers/Footers to Previous Section Headers/Footers

When a section omits a header or footer of a given type, applications that visualize the flow document can inherit that header or footer from the previous section. This behavior is commonly described as linked to previous. If the document has no previous section, a blank header or footer is used instead.

For example, if a document has two sections and only the first section defines the Default, Even, and First headers or footers, the second section can render with the same content. If you want the second section to display blank headers or footers, assign explicit blank header or footer content for that section.

Adding Watermarks to Header

Header elements expose a Watermarks collection. Use its Add() method to add a Watermark to a specific header instance.

For more information about supported watermark types and usage patterns, see Watermark.

You can add PAGE, DATE, and other fields to headers and footers so the content updates automatically as the document changes. For implementation details, see Fields.

See Also