TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

SetTextPr

SetTextPr(oTextPr)

Sets the text properties of the watermark in the document.

Parameters:

Name Type Description
oTextPr ApiTextPr

The watermark text properties.

Returns:

This method doesn't return any data.

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("A watermark was inserted into this document.");
oDocument.InsertWatermark("Watermark", true);
var oSettings = oDocument.GetWatermarkSettings();
var oTextPr = oSettings.GetTextPr();
oTextPr.SetFontSize(192);
oTextPr.SetItalic(true);
oTextPr.SetColor(255, 111, 6, false);
oTextPr.SetCaps(true);
oTextPr.SetSpacing(80);
oSettings.SetTextPr(oTextPr);
oDocument.SetWatermarkSettings(oSettings);
builder.SaveFile("docx", "SetTextPr.docx");
builder.CloseFile();

Resulting document