setText method

setText(text)

Adds Text watermark into the document.

setText(text: string)
ParameterTypeDescription
textstringText that is displayed as a watermark.

Remarks

The text length must be in the range from 1 to 200 inclusive. The text cannot be null or contain only whitespaces.

Exceptions

exceptioncondition
RuntimeError (Proxy error(ArgumentOutOfRangeException))Throws when the text length is out of range or the text contains only whitespaces.
RuntimeError (Proxy error(ArgumentNullException))Throws when the text is null.

setText(text, options)

Adds Text watermark into the document.

setText(text: string, options: Aspose.Words.TextWatermarkOptions)
ParameterTypeDescription
textstringText that is displayed as a watermark.
optionsTextWatermarkOptionsDefines additional options for the text watermark.

Remarks

The text length must be in the range from 1 to 200 inclusive. The text cannot be null or contain only whitespaces.

If TextWatermarkOptions is null, the watermark will be set with default options.

Exceptions

exceptioncondition
RuntimeError (Proxy error(ArgumentOutOfRangeException))Throws when the text length is out of range or the text contain only whitespaces.
RuntimeError (Proxy error(ArgumentNullException))Throws when the text is null.

See Also