Skip to main content

TocPr

Table of contents properties.

Type

Object

Properties

NameTypeDescription
ShowPageNumsbooleanSpecifies whether to show page numbers in the table of contents.
RightAlgnbooleanSpecifies whether to right-align page numbers in the table of contents.
LeaderTypeTocLeaderThe leader type in the table of contents.
FormatAsLinksbooleanSpecifies whether to format the table of contents as links.
BuildFromTocBuildFromPrSpecifies whether to generate the table of contents from the outline levels or the specified styles.
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);