跳到主要内容

SetRightAlignPageNumbers

指定图表目录中的页码是否右对齐。

备注

此功能仅在 ONLYOFFICE Docs 付费版本中可用。

语法​

expression.SetRightAlignPageNumbers(isRightAlign);

expression - 表示 ApiTableOfFigures 类的变量。

参数​

名称必需/可选数据类型默认值描述
isRightAlign必需boolean未提供描述。

返回值​

boolean

示例​

使页码紧跟在图表目录条目文本之后。

// Add a captioned figure and a table of figures built from the "Figure" label.

// Disable right alignment so page numbers follow the entry text directly.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("Figure 1");
paragraph.AddCaption(" - Sample figure", "Figure", false, "Arabic", false, undefined, "hyphen");
let tof = doc.AddTableOfFigures({"BuildFrom": "Figure", "LabelNumber": true});
tof.SetRightAlignPageNumbers(false);