Skip to main content

PageWatermark.TextDirection Property

Gets or sets the incline of the PageWatermark‘s text.

Namespace: DevExpress.XtraPrinting.Drawing

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

NuGet Packages: DevExpress.Printing.Core, DevExpress.Win.Dashboard.Design

Declaration

[DefaultValue(DirectionMode.ForwardDiagonal)]
public DirectionMode TextDirection { get; set; }

Property Value

Type Default Description
DirectionMode ForwardDiagonal

A DirectionMode enumeration value representing the text incline.

Available values:

Name Description
Horizontal

Specifies an incline from left to right.

ForwardDiagonal

Specifies an incline from upper right to lower left.

BackwardDiagonal

Specifies an incline from upper left to lower right.

Vertical

Specifies an incline from top to bottom.

Remarks

This member is only in effect for a text watermark.

Example

This example demonstrates how to add a text watermark (the SetTextWatermark method) or an image watermark (the SetPictureWatermark method) to a printing system document.

using System.Drawing;
using DevExpress.XtraPrinting;
using DevExpress.XtraPrinting.Drawing;
using DevExpress.Drawing;
// ...
public void SetTextWatermark(PrintingSystem ps) {
    // Create the text watermark.
    Watermark textWatermark = new Watermark();

    // Set watermark options.
    textWatermark.Text = "CUSTOM WATERMARK TEXT";
    textWatermark.TextDirection = DirectionMode.ForwardDiagonal;
    textWatermark.Font = new DXFont(textWatermark.Font.Name, 40);
    textWatermark.ForeColor = Color.DodgerBlue;
    textWatermark.TextTransparency = 150;
    textWatermark.ShowBehind = false;
    textWatermark.PageRange = "1,3-5";

    // Set the watermark to a document.
    ps.Watermark.CopyFrom(textWatermark);
}
public void SetPictureWatermark(PrintingSystem ps) {
    // Create the text watermark.
    Watermark pictureWatermark = new Watermark();

    // Set watermark options.
    pictureWatermark.ImageSource = ImageSource.FromFile("Watermark.png");
    pictureWatermark.ImageAlign = ContentAlignment.TopCenter;
    pictureWatermark.ImageTiling = false;
    pictureWatermark.ImageViewMode = ImageViewMode.Stretch;
    pictureWatermark.ImageTransparency = 150;
    pictureWatermark.ShowBehind = true;
    pictureWatermark.PageRange = "2,4";

    // Set the watermark to a document.
    ps.Watermark.CopyFrom(pictureWatermark);
}

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

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.

See Also