Skip to main content

PageArea.LineAlignment Property

Gets or sets a value specifying which edge (top, center or bottom) of the page area its content should be aligned.

Namespace: DevExpress.XtraPrinting

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

NuGet Package: DevExpress.Printing.Core

#Declaration

public BrickAlignment LineAlignment { get; set; }

#Property Value

Type Description
BrickAlignment

A BrickAlignment enumeration value specifying the content alignment.

Available values:

Name Description
None

Cancels brick alignment.

Near

Specifies that the text shall be aligned near the layout. In a left-to-right layout, the near position is left. In a right-to-left layout, the near position is right.

Center

Specifies whether a brick is aligned by the center of the layout rectangle.

Far

Specifies whether a brick is aligned away from the original position of the layout rectangle.

#Remarks

The LineAlignment property specifies the alignment of the page area’s text defined by the PageArea.Content property.

#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