LayoutCollector - wrong page number

There seems to be a bug in the LayoutCollector. It thinks that the first run on page #2 is part of page #1. Here is some code to reproduce (set a break point on: “*** This should be the start of page two” ).

Aspose.Words v13.5.0.0
Microsoft Word 2013
.NET 4.5

Thanks!

var doc = new Document("Hamlet.docx");
var collector = new LayoutCollector(doc);
NodeCollection paragraphs = doc.GetChildNodes(NodeType.Paragraph, true);
bool nextRunIsPageTwo = false;

foreach (Paragraph curParagraph in paragraphs)
{
    Console.WriteLine("*** New Paragraph");
    foreach (Run curRun in curParagraph.Runs)
    {
        if (nextRunIsPageTwo)
        {
            Console.WriteLine("*** This should be the start of page two");
            nextRunIsPageTwo = false;
        }

        Console.WriteLine("{0}-{1}: {2}",
        collector.GetStartPageIndex(curRun),
        collector.GetEndPageIndex(curRun),
        curRun.Text);

        if (curRun.Text.Contains("Exit"))
            nextRunIsPageTwo = true;
    }

Hi Greg,
I was able to reproduce this issue at my end. The issue has been logged into our issue tracking system as WORDSNET-9368. We will keep you updated on this issue in this thread.
Sorry for the inconvenience.
Best Regards,

excellent, thank-you!

The issues you have found earlier (filed as WORDSNET-9368) have been fixed in this Aspose.Words for .NET 22.8 update also available on NuGet.