跳到主要内容

TocBuildFromPr

指定是从大纲级别还是指定样式生成目录的目录属性。

类型

对象

属性

名称类型描述
OutlineLvlsnumber目录中的最大级别数。
StylesLvlsTocStyleLvl[]样式级别(例如 [{Name: "Heading 1", Lvl: 2}, {Name: "Heading 2", Lvl: 3}])。💡 如果 StylesLvls.length > 0,则 OutlineLvls 属性将被忽略。

示例

This example adds a table of contents which is generated from 9 outline levels to the document.

// How to create a table of contents properties indicating the source from which it should be generated.

// Add a table of contents from the nine outline levels of the document.

let tocBuildFromPr = { "OutlineLvls": 9 };
let tocPr = {
"ShowPageNums": true,
"RightAlgn": true,
"LeaderType": "dot",
"FormatAsLinks": true,
"BuildFrom": tocBuildFromPr,
"TocStyle": "standard"
};
doc.AddTableOfContents(tocPr);