TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

SetImageURL

SetImageURL(sURL)

Sets the image URL of the watermark in the document.

Parameters:

Name Type Description
sURL string

The watermark image URL.

Returns:

This method doesn't return any data.

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
oDocument.InsertWatermark("Watermark");
var oSettings = oDocument.GetWatermarkSettings();
oSettings.SetType("image");
oSettings.SetImageURL("https://api.onlyoffice.com/content/img/docbuilder/examples/onlyoffice_logo.png");
oSettings.SetImageSize(100 * 36000, 100 * 36000);
oDocument.SetWatermarkSettings(oSettings);
var sImage = oSettings.GetImageURL();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("Watermark image URL: "+ sImage);
builder.SaveFile("docx", "SetImageURL.docx");
builder.CloseFile();

Resulting document