Skip to main content

PageArea Class

Serves as the base for classes that specify information to be displayed in page header and page footer areas.

Namespace: DevExpress.XtraPrinting

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

NuGet Package: DevExpress.Printing.Core

Declaration

[TypeConverter("DevExpress.XtraPrinting.Design.PageAreaConverter,DevExpress.XtraPrinting.v24.1.Design")]
public class PageArea

The following members return PageArea objects:

Remarks

The PageArea class introduces the PageArea.Content property that contains three strings, specifying the kind of information to be displayed in a page header and page footer. In addition, this class introduces the PageArea.Font and PageArea.LineAlignment properties, that determine the appearance of this information.

Example

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

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();
}
See Also