Skip to main content

SetImageURL

Sets the image URL of the watermark in the document.

Syntax

expression.SetImageURL(sURL);

expression - A variable that represents a ApiWatermarkSettings class.

Parameters

NameRequired/OptionalData typeDefaultDescription
sURLRequiredstringThe watermark image URL.

Returns

boolean

Example

This example sets the parameters of the watermark settings and apply them to the document.

// How to set the image URL of the watermark.

// Indicate the link address to the image using the watermark settings.

let doc = Api.GetDocument();
let watermarkSettings = doc.GetWatermarkSettings();
watermarkSettings.SetType("image");
watermarkSettings.SetImageURL("https://static.onlyoffice.com/assets/docs/samples/img/onlyoffice_logo.png");
watermarkSettings.SetImageSize(36000 * 70, 36000 * 80);
watermarkSettings.SetDirection("clockwise45");
watermarkSettings.SetOpacity(200);
doc.SetWatermarkSettings(watermarkSettings);