SetWatermarkSettings

SetWatermarkSettings(Settings) → { ApiDrawing }

Sets the watermark settings in the current document.

Parameters:

Name Type Description
Settings ApiWatermarkSettings

The object which represents the watermark settings.

Returns:

Type
ApiDrawing

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("A watermark was inserted into this document.");
oDocument.InsertWatermark("Watermark", true);
var oSettings = oDocument.GetWatermarkSettings();
oSettings.SetText("ONLYOFFICE");
oDocument.SetWatermarkSettings(oSettings);
builder.SaveFile("docx", "SetWatermarkSettings.docx");
builder.CloseFile();

Resulting document