TextWatermark Class
Represents a text watermark.
Inheritance Hierarchy

Namespace: GroupDocs.Watermark
Assembly: GroupDocs.Watermark (in GroupDocs.Watermark.dll) Version: 19.5
Syntax
public class TextWatermark : Watermark

The TextWatermark type exposes the following members.

Constructors
  NameDescription
Public methodTextWatermark
Initializes a new instance of the TextWatermark class.
Properties
  NameDescription
Public propertyBackgroundColor
Gets or sets the background color of the text.
Public propertyConsiderParentMargins
Gets or sets a value indicating whether the watermark size and coordinates are calculated considering parent margins.
(Inherited from Watermark.)
Public propertyFont
Gets or sets the font of the text.
Public propertyForegroundColor
Gets or sets the foreground color of the text.
Public propertyHeight
Gets or sets the desired height of this Watermark. Setting this property will also change the value of SizingType property to Absolute.
(Inherited from Watermark.)
Public propertyHorizontalAlignment
Gets or sets the horizontal alignment of this Watermark.
(Inherited from Watermark.)
Public propertyIsBackground
Gets or sets a value indicating whether the watermark should be placed at background.
(Inherited from Watermark.)
Public propertyMargins
Gets or sets the margin settings of this Watermark.
(Inherited from Watermark.)
Public propertyOpacity
Gets or sets the opacity of this Watermark.
(Inherited from Watermark.)
Public propertyRotateAngle
Gets or sets the rotate angle of this Watermark in degrees.
(Inherited from Watermark.)
Public propertyScaleFactor
Gets or sets a value that defines how watermark size depends on parent size.
(Inherited from Watermark.)
Public propertySizingType
Gets or sets a value specifying a way watermark should be sized.
(Inherited from Watermark.)
Public propertyText
Gets or sets the text to be used as watermark.
Public propertyTextAlignment
Gets or sets the watermark text alignment.
Public propertyVerticalAlignment
Gets or sets the vertical alignment of this Watermark.
(Inherited from Watermark.)
Public propertyWidth
Gets or sets the desired width of this Watermark. Setting this property will also change the value of SizingType property to Absolute.
(Inherited from Watermark.)
Public propertyX
Gets or sets the x-coordinate of this Watermark.
(Inherited from Watermark.)
Public propertyY
Gets or sets the y-coordinate of this Watermark.
(Inherited from Watermark.)
Methods
  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Examples
Add text watermark to a document of any supported format.
C#
// Load a document from a file.
using (Document document = Document.Load("C:\\input.xls"))
{
    // Create TextWatermark instance.
    TextWatermark watermark = new TextWatermark("Test watermark", new Font("Arial", 42));

    // Add watermark to the document.
    document.AddWatermark(watermark);

    // Save changes.
    document.Save("C:\\output.xls");
}
See Also