SetType
Sets the type of the watermark in the document.
Syntax
expression.SetType(sType);
expression - A variable that represents a ApiWatermarkSettings class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| sType | Required | WatermarkType | The watermark type. |
Returns
boolean
Example
Switch the watermark to text mode and configure its appearance in a document.
// How do I set the watermark type to text in a document?
// Control whether the watermark displays as text or an image in a document.
let doc = Api.GetDocument();
let watermarkSettings = doc.GetWatermarkSettings();
watermarkSettings.SetType("text");
watermarkSettings.SetText("Example");
let textPr = watermarkSettings.GetTextPr();
textPr.SetFontFamily("Calibri");
textPr.SetFontSize(-1);
textPr.SetDoubleStrikeout(true);
textPr.SetItalic(true);
textPr.SetBold(true);
textPr.SetUnderline(true);
textPr.SetColor(Api.RGB(0, 255, 0));
textPr.SetHighlight("blue");
watermarkSettings.SetTextPr(textPr);
doc.SetWatermarkSettings(watermarkSettings);