Click or drag to resize

DocumentInsertTableOfContents Method

Inserts the table of contents at the specified page position, on pages of the same size, orientation and margins as the page at that position (or as the last page, when the position is after the last page).

Namespace: ExpertPdf.HtmlToPdf.PdfDocument
Assembly: ephtmltopdf (in ephtmltopdf.dll) Version: 22.0.0
Syntax
public int InsertTableOfContents(
	TableOfContents tableOfContents,
	int pageIndex
)

Parameters

tableOfContents  TableOfContents
The table of contents, with its entries.
pageIndex  Int32
The zero based index where the first table of contents page is inserted.

Return Value

Int32
The number of pages inserted.
Remarks

Each entry shows its text, indented by its level, a dotted leader and the number of the page it points to, and is a link to that page. The page numbers are the ones of the pages after the table of contents is inserted - they are the page labels when the document has page label ranges (see AddPageLabelRange(Int32, PageLabelStyle, String, Int32)). As many pages as the entries need are inserted.

Insert the table of contents after the content it lists is added. Page label ranges already added that start at or after pageIndex move with their pages, so a document can number its content first (for example AddPageLabelRange(0, PageLabelStyle.LowercaseRoman) for a cover and AddPageLabelRange(1, PageLabelStyle.Decimal) for the body) and then insert the table of contents after the cover: the table pages continue the cover's numbering and the body still starts at 1.

See Also