TOC Link Not Redirecting in HTML When Using ExtractPages

Hii Team, We are facing an issue with the Table of Contents (TOC) where the TOC link is not redirecting correctly in the HTML output , although it works properly in the Word output .

The issue occurs when we extract the document page by page. During page extraction, the bookmark for item number 18 is removed , which causes the TOC link to stop working. However, the bookmark for item number 19 works correctly .

If we generate the output without splitting the document into pages , the TOC links work as expected.

Below is the code snippet used for extracting pages:

Aspose.Words.Document tempDoc = (Aspose.Words.Document)doc.Clone(false);
Aspose.Words.Document page = null;

for (int i = 0; i < doc.PageCount; i++)
{
    page = doc.ExtractPages(i, 1);
    tempDoc.AppendDocument(page, ImportFormatMode.KeepSourceFormatting, new ImportFormatOptions() { KeepSourceNumbering = true });
}

tempDoc.Save(@"Documents" + Path.DirectorySeparatorChar + "BookMark.html", options);

Source :
BookMark.docx (42.8 KB)

Output:
BookMark.zip (3.2 KB)

Please review the source file and let us know why the bookmark is being removed during page extraction.

@MeetPatel The problem is not reproducible with the latest 26.2 version of Aspose.Words. here is the output produce on my side using the latest version of Aspose.Words:
out.zip (3.1 KB)

Also, please note that when Document.ExtractPages method is used, the content is extracted as a separate documents. Rejoining these documents does not guaranty to retain the original document structure.