TOC page number change in Word document not captured in Comapre

the Aspose.Words for .net functionality does not highlight the change of page numbers in the TOC. We would expect Aspose.Words for .net to capture and highlight TOC page number changes.
Strangely enough, the TOC changes are recognized and highlighted when there are other changes in the TOC than only page numbers.

static void Main(string[] args)
{
    string document1 = "TOC Compare 1.docx";
    string document2 = "TOC Compare 2.docx";

    // Load both documents in Aspose.Words
    Console.WriteLine("Load original document: " + document1);
    Aspose.Words.Document docOriginal = new Aspose.Words.Document(document1);

    Console.WriteLine("Load modified document: " + document2);
    Aspose.Words.Document docModified = new Aspose.Words.Document(document2);

    docOriginal.Compare(docModified, "Compare Service", DateTime.Now);

    string comparisonDocument = "TOC Compare output.docx";
    Console.WriteLine("Save DOCX compare document: " + comparisonDocument);
    docOriginal.Save(comparisonDocument);

    string comparisonDocumentPDF = "TOC Compare output.pdf";
    Console.WriteLine("Save PDF compare document: " + comparisonDocumentPDF);
    docOriginal.Save(comparisonDocumentPDF, new PdfSaveOptions());
}

See the attached:
TOC Compare 1.docx (38.4 KB)
TOC Compare 2.docx (35.8 KB)
TOC Compare output.docx (37.2 KB)
TOC Compare output.pdf (113.1 KB)

@AlesGregor It looks like an expected behavior. I have compared documents using MS Word and it also does not show difference in TOC page numbers: ms.docx (25.4 KB)

This can be explained by the fact that TOC page numbers are dynamic values and are updated depending on the document content.

Hi @alexey.noskov, it kind of makes sense, but if there are other changes that only page numbers in the TOC the behaviour is different. See the attached documents. Note that how the compare result document is displayed in MSWord depends on the Show Markup settings. Check the PDF output as well.

TOC Compare 1.docx (38.4 KB)
TOC Compare 2.docx (29.7 KB)
TOC Compare output.docx (43.0 KB)
TOC Compare output.pdf (125.0 KB)

@AlesGregor As I can see in this case Aspose.Words behavior also matches MS Word behavior:
ms.docx (27.2 KB)
aspose.docx (31.8 KB)

The differences after comparing documents are revisions. Revisions appearance in MS Word can vary depending on the setting set in MS Word. You can control how revisions are exported to PDF using RevisionOptions.