跳到主要内容

GetTextPr

返回文档中水印的文本属性。

语法

expression.GetTextPr();

expression - 表示 ApiWatermarkSettings 类的变量。

参数

此方法没有任何参数。

返回值

ApiTextPr

示例

读取文档中应用于水印文本的格式。

// How do I find out what font and style settings the watermark text uses in a document?

// Inspect the visual style of the text used as a watermark in a document.

let doc = Api.GetDocument();
let watermarkSettings = doc.GetWatermarkSettings();
watermarkSettings.SetType("text");
watermarkSettings.SetText("Example");
let textPr = watermarkSettings.GetTextPr();
textPr.SetFontFamily("Calibri");
textPr.SetFontSize(-1);
textPr.SetDoubleStrikeout(true);
textPr.SetItalic(true);
textPr.SetBold(true);
textPr.SetUnderline(true);
textPr.SetColor(Api.RGB(0, 255, 0));
textPr.SetHighlight("blue");
watermarkSettings.SetTextPr(textPr);
doc.SetWatermarkSettings(watermarkSettings);