TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

GetOpacity

GetOpacity() → { number }

Returns the opacity of the watermark in the document.

Parameters:

This method doesn't have any parameters.

Returns:

Type
number

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
oDocument.InsertWatermark("Watermark", true);
var oSettings = oDocument.GetWatermarkSettings();
var nOpacity = oSettings.GetOpacity();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("Watermark opacity: "+ nOpacity);
builder.SaveFile("docx", "GetOpacity.docx");
builder.CloseFile();

Resulting document