Skip to main content

Headers and Footers

DXRich_Edit_Footer

Each section in the document can have its own set of headers and footers. If no headers or footers are defined for a given section, then headers and footers from a previous section (if any) are used.

To enter header (footer) editing mode, use the EditPageHeaderCommand or the EditPageFooterCommand commands.

You can also use the Section.BeginUpdateHeader - Section.EndUpdateHeader or the Section.BeginUpdateFooter - Section.EndUpdateFooter method pairs to create and modify the header/footer programmatically.

The header (or footer) can be different for odd pages, even pages or the first page. To switch display modes, use the ToggleDifferentFirstPageCommand and ToggleDifferentOddAndEvenPagesCommand commands.

To insert fields displaying a current page number or the total number of pages, use the InsertPageNumberFieldCommand and the InsertPageCountFieldCommand commands.

To modify text selected in the header/footer (Document.Selection) or the text at the cursor position (Document.CaretPosition), use the DocumentRange.BeginUpdateDocument or the DocumentPosition.BeginUpdateDocument methods.