SetOpacity
function SetOpacity(nOpacity: number = null): void
Description
Sets the opacity of the watermark in the document.
Parameters
- nOpacity
number
null The watermark opacity. This value must be from 0 to 255.
Returns
void
Try It
const oDocument = Api.GetDocument();
const oWatermarkSettings = oDocument.GetWatermarkSettings();
oWatermarkSettings.SetType("text");
oWatermarkSettings.SetText("Example");
const oTextPr = oWatermarkSettings.GetTextPr();
oTextPr.SetFontFamily("Calibri");
oTextPr.SetFontSize(-1);
oTextPr.SetDoubleStrikeout(true);
oTextPr.SetItalic(true);
oTextPr.SetBold(true);
oTextPr.SetUnderline(true);
oTextPr.SetColor(0, 255, 0);
oWatermarkSettings.SetTextPr(oTextPr);
oWatermarkSettings.SetOpacity(127);
oDocument.SetWatermarkSettings(oWatermarkSettings);