Using the attached document with the following code shows 7 search results all on page 0.
There should be 14 search results however, 7 on page 0 and again 7 on page 1.
I was using GroupDocs.Parser 20.12 in .NET and was searching for the word “class”.
Portrait Landscape.zip (14.1 KB)
using (Parser parser = new Parser("Portrait Landscape.docx"))
{
// Search a keyword with page numbers
IEnumerable<SearchResult> sr = parser.Search("class", new SearchOptions(false, false, false, true));
// Iterate over search results
foreach (SearchResult s in sr)
{
// Print an index, page number and found text:
Console.WriteLine(string.Format("At {0} (page {1}): {2}", s.Position, s.PageIndex, s.Text));
}
}