Skip to main content

PageHeaderFooter Class

Represents the object, containing information about the page header and page footer areas.

Namespace: DevExpress.XtraPrinting

Assembly: DevExpress.Printing.v22.1.Core.dll

Declaration

public class PageHeaderFooter

Remarks

The page header and page footer’s content can be accessed via the PageArea.Content property of the PageHeaderFooter.Header and PageHeaderFooter.Footer, respectively. Also, their appearance is specified by the PageArea.Font and PageArea.LineAlignment properties of these areas.

Example

This example demonstrates how to use the link’s PageHeaderFooter to add extra information to the document’s page header.

Tip

A complete sample project is available in the DevExpress Code Examples database at https://supportcenter.devexpress.com/ticket/details/e1021/how-to-insert-system-information-to-the-page-header-and-footer.

using System;
using System.Windows.Forms;
using DevExpress.XtraPrinting;
// ...

private void button1_Click(object sender, EventArgs e) {
    string leftColumn = "Pages: [Page # of Pages #]";
    string middleColumn = "User: [User Name]";
    string rightColumn = "Date: [Date Printed]";

    // Create a PageHeaderFooter object and initializing it with
    // the link's PageHeaderFooter.
    PageHeaderFooter phf = printableComponentLink1.PageHeaderFooter as PageHeaderFooter;

    // Clear the PageHeaderFooter's contents.
    phf.Header.Content.Clear();

    // Add custom information to the link's header.
    phf.Header.Content.AddRange(new string[] { leftColumn, middleColumn, rightColumn });
    phf.Header.LineAlignment = BrickAlignment.Far;

    // Show the document's preview.
    printableComponentLink1.ShowPreview();
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the PageHeaderFooter class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

Inheritance

Object
PageHeaderFooter
See Also