跳到主要内容

TocPr

Table of contents properties.

Type

Object

Properties

NameTypeDescription
BuildFromTocBuildFromPrSpecifies whether to generate the table of contents from the outline levels or the specified styles.
FormatAsLinksbooleanSpecifies whether to format the table of contents as links.
LeaderTypeTocLeaderThe leader type in the table of contents.
RightAlgnbooleanSpecifies whether to right-align page numbers in the table of contents.
ShowPageNumsbooleanSpecifies whether to show page numbers in the table of contents.
TocStyleTocStyleThe table of contents style type.

Example

This example adds a table of contents with the specified properties to the document.

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