GetImageHeight

GetImageHeight() → { EMU | null }

Returns the height of the watermark image in the document.

Parameters:

This method doesn't have any parameters.

Returns:

Type
EMU | null

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 nHeight = oSettings.GetImageHeight();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("Watermark image height: "+ nHeight);
builder.SaveFile("docx", "GetImageHeight.docx");
builder.CloseFile();

Resulting document