Click or drag to resize

TableOfEntriesUpdate Method

Performs an update on TOC (Table of Contents) field.

Namespace:  GemBox.Document
Assembly:  GemBox.Document (in GemBox.Document.dll) Version:
public void Update()

Update method is used for updating entire TOC field with new entries.

If InstructionText is not specified Update method will set a default set of switches: \o "1-3" \h \u \z.

GemBox.Document automatically updates page numbers in TOC entries only for PDF, XPS and image file formats, for DOCX file format page numbers have a default value 1. Updating page numbers for TOC entries in DOCX can be achieved by creating an instance of PaginatorOptions, setting its UpdateFields to and calling the GetPaginator(PaginatorOptions) method with that PaginatorOptions instance.

Supported TOC switches:
  • \o - Specifies the OutlineLevel of enlisting header paragraphs.
  • \u - Specifies enlistment of all paragraphs with OutlineLevel not equal to BodyText.
  • \f - Specifies a unique identifier for TC fields enlistment.
  • \h - Specifies a Hyperlink usage.
  • \n - Specifies the OutlineLevel of entries with omitted page number.
  • \l - Specifies the OutlineLevel of enlisting TC fields.
  • \p - Specifies the character that separates entry and its page number.
  • \b - Specifies the name of the bookmark from which the paragraphs are enlisted.
Supported TC switches:
  • \f - TC field's unique identifier.
  • \l - TC field's OutlineLevel.
  • \n - Omit page number.

For more information about TOC switches, see Field codes: TOC (Table of Contents) field.

For more information about TC switches, see Field codes: TC (Table of Contents Entry) field.

See Also