GemBox.Document
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    TextWatermark Class

    Namespace:
    GemBox.Document
    Assembly:
    GemBox.Document.dll

    Represents the text watermark that appears behind the document content.

    • C#
    • VB.NET
    public class TextWatermark : Watermark
    Public Class TextWatermark
        Inherits Watermark
    Inheritance:
    System.Object
    Watermark
    TextWatermark

    Constructors

    TextWatermark(DocumentModel, String)

    Initializes a new instance of the text watermark with the default width and height.

    • C#
    • VB.NET
    public TextWatermark(DocumentModel document, string text)
    Public Sub New(document As DocumentModel, text As String)
    Parameters
    document
    DocumentModel

    The owner document.

    text
    System.String

    The text of the watermark.

    TextWatermark(DocumentModel, String, Double, Double)

    Initializes a new instance of the text watermark with the given width and height.

    • C#
    • VB.NET
    public TextWatermark(DocumentModel document, string text, double width, double height)
    Public Sub New(document As DocumentModel, text As String, width As Double, height As Double)
    Parameters
    document
    DocumentModel

    The owner document.

    text
    System.String

    The text of the watermark.

    width
    System.Double

    The width of the watermark (in points).

    height
    System.Double

    The height of the watermark (in points).

    TextWatermark(DocumentModel, String, Double, Double, LengthUnit)

    Initializes a new instance of the text watermark with the given width and height.

    • C#
    • VB.NET
    public TextWatermark(DocumentModel document, string text, double width, double height, LengthUnit lengthUnit)
    Public Sub New(document As DocumentModel, text As String, width As Double, height As Double, lengthUnit As LengthUnit)
    Parameters
    document
    DocumentModel

    The owner document.

    text
    System.String

    The text of the watermark.

    width
    System.Double

    The width of the watermark.

    height
    System.Double

    The height of the watermark.

    lengthUnit
    LengthUnit

    The used length unit.

    Properties

    Color

    Gets or sets the font color used for the watermark.

    • C#
    • VB.NET
    public Color Color { get; set; }
    Public Property Color As Color
    Property Value
    Color

    The font color used for the watermark.

    Remarks

    Changing the font color also changes the transparency of the text which can affect the Semitransparent property.

    FontName

    Gets or sets the font name used for the watermark.

    • C#
    • VB.NET
    public string FontName { get; set; }
    Public Property FontName As String
    Property Value
    System.String

    The font name used for the watermark.

    Semitransparent

    Gets or sets whether the text of the watermark will be semitransparent. The default value is true.

    • C#
    • VB.NET
    public bool Semitransparent { get; set; }
    Public Property Semitransparent As Boolean
    Property Value
    System.Boolean

    True if the text of the watermark should be semitransparent, false otherwise.

    Size

    Gets or sets the size of the watermark shape. To set the size as default, use empty size.

    • C#
    • VB.NET
    public Size Size { get; set; }
    Public Property Size As Size
    Property Value
    Size

    The size of the watermark shape.

    Remarks

    The height of the TextWatermark is ignored when saving to PDF, XPS, and image formats. This is because GemBox.Document currently doesn't support scaling of characters in these formats which is necessary to support height independently of width. Currently the width is used and height is calculated to naturally fit the chosen font.

    Text

    Gets or sets the text of the watermark.

    • C#
    • VB.NET
    public string Text { get; set; }
    Public Property Text As String
    Property Value
    System.String

    The text of the watermark.

    TextBox

    Gets the underlying TextBox that represents the watermark.

    • C#
    • VB.NET
    public TextBox TextBox { get; }
    Public ReadOnly Property TextBox As TextBox
    Property Value
    TextBox

    The TextBox that represents the watermark.

    Methods

    SetDiagonal()

    Sets the text of the watermark as diagonal (rotated).

    • C#
    • VB.NET
    public void SetDiagonal()
    Public Sub SetDiagonal

    SetHorizontal()

    Sets the text of the watermark as horizontal.

    • C#
    • VB.NET
    public void SetHorizontal()
    Public Sub SetHorizontal
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.