Skip to main content

GetImageURL

Returns the image URL of the watermark in the document.

Syntax

expression.GetImageURL();

expression - A variable that represents a ApiWatermarkSettings class.

Parameters

This method doesn't have any parameters.

Returns

string | null

Example

Read the web address of a watermark image in a document.

// How do I find out where the watermark image is loaded from in a document?

// Retrieve the source link of a watermark image in a document.

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);
let paragraph = Api.CreateParagraph();
paragraph.AddText("Watermark URL = " + doc.GetWatermarkSettings().GetImageURL());
doc.Push(paragraph);