TextWatermark Class
Represents a text watermark.
Inheritance Hierarchy
SystemObject
GroupDocs.WatermarkWatermark
GroupDocs.Watermark.WatermarksTextWatermark

Namespace: GroupDocs.Watermark.Watermarks
Assembly: GroupDocs.Watermark (in GroupDocs.Watermark.dll) Version: 20.7.0
Syntax
`public class TextWatermark : Watermark`

The TextWatermark type exposes the following members.

Constructors
NameDescription
TextWatermark
Initializes a new instance of the TextWatermark class with a specified text and a font.
Properties
NameDescription
BackgroundColor
Gets or sets the background color of the text.
ConsiderParentMargins
Gets or sets a value indicating whether the watermark size and coordinates are calculated considering parent margins.
(Inherited from Watermark.)
Font
Gets or sets the font of the text.
ForegroundColor
Gets or sets the foreground color of the text.
Height
Gets or sets the desired height of this Watermark.
(Inherited from Watermark.)
HorizontalAlignment
Gets or sets the horizontal alignment of this Watermark.
(Inherited from Watermark.)
IsBackground
Gets or sets a value indicating whether the watermark should be placed at background.
(Inherited from Watermark.)
Margins
Gets or sets the margin settings of this Watermark.
(Inherited from Watermark.)
Opacity
Gets or sets the opacity of this Watermark.
(Inherited from Watermark.)
RotateAngle
Gets or sets the rotate angle of this Watermark in degrees.
(Inherited from Watermark.)
ScaleFactor
Gets or sets a value that defines how watermark size depends on parent size.
(Inherited from Watermark.)
SizingType
Gets or sets a value specifying a way watermark should be sized.
(Inherited from Watermark.)
Text
Gets or sets the text to be used as watermark.
TextAlignment
Gets or sets the watermark text alignment.
VerticalAlignment
Gets or sets the vertical alignment of this Watermark.
(Inherited from Watermark.)
Width
Gets or sets the desired width of this Watermark.
(Inherited from Watermark.)
X
Gets or sets the x-coordinate of this Watermark.
(Inherited from Watermark.)
Y
Gets or sets the y-coordinate of this Watermark.
(Inherited from Watermark.)
Methods
NameDescription
Equals (Inherited from Object.)
Finalize (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
ToString (Inherited from Object.)
Remarks
Examples
Scale the text watermark depending on the parent size.
C#
```foreach (string file in Directory.GetFiles("C:\\test"))
{
using (Watermarker watermarker = new Watermarker(file))
{
TextWatermark watermark = new TextWatermark("test watermark", new Font("Arial", 36));
watermark.HorizontalAlignment = HorizontalAlignment.Center;
watermark.VerticalAlignment = VerticalAlignment.Center;
watermark.SizingType = SizingType.ScaleToParentDimensions;
watermark.RotateAngle = 45;
watermark.ScaleFactor = 0.4;