diff --git a/net/images/rendering-basics/render-word-documents/unlink-table-of-contents.png b/net/images/rendering-basics/render-word-documents/unlink-table-of-contents.png new file mode 100644 index 0000000..0539a8c Binary files /dev/null and b/net/images/rendering-basics/render-word-documents/unlink-table-of-contents.png differ diff --git a/net/rendering-basics/render-word-documents.md b/net/rendering-basics/render-word-documents.md index 4db75a5..0e67b42 100644 --- a/net/rendering-basics/render-word-documents.md +++ b/net/rendering-basics/render-word-documents.md @@ -279,3 +279,32 @@ using (var viewer = new Viewer("resume.docx")) The following image illustrates the result: ![Render comments to PDF](/viewer/net/images/rendering-basics/render-word-documents/render-comments-to-pdf.png) + +## Unlink table of contents + +When rendering to HTML or PDF, you can set [WordProcessingOptions.UnlinkTableOfContents](https://reference.groupdocs.com/net/viewer/groupdocs.viewer.options/wordprocessingoptions/properties/unlinktableofcontents) to `true` to unlink table of contents. For HTML rendering, `` tags with relative links will be replaced with `` tags, removing functionality but preserving visual appearance. For PDF rendering, the table of contents will be rendered as plain text without links to document sections. + +The code example below renders a Word document with table of contents as a plain text without links. + +{{< tabs "example9">}} +{{< tab "C#" >}} +```csharp +using GroupDocs.Viewer; +using GroupDocs.Viewer.Options; +// ... + +using (var viewer = new Viewer("resume.docx")) +{ + // Convert the document to HTML. + var viewOptions = HtmlViewOptions.ForEmbeddedResources(); + // Unlink table of contents. + viewOptions.WordProcessingOptions.UnlinkTableOfContents = true; + viewer.View(viewOptions); +} +``` +{{< /tab >}} +{{< /tabs >}} + +The following image illustrates the result: + +![Unlink table of contens in Word files](/viewer/net/images/rendering-basics/render-word-documents/unlink-table-of-contents.png) \ No newline at end of file