Skip to main content

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​

Add a table of contents with the specified properties to the document.

// How to create a table of contents properties.

// Add a table of contents from the properties.

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