Search returns null for PageIndex when searching the attached .docx file.
I used GroupDocs.Parser 20.12 with the following code:
Landscape.zip (10.2 KB)
using (Parser parser = new Parser("Landscape.docx"))
{
// Search a keyword with page numbers
IEnumerable<SearchResult> sr = parser.Search("usage", 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));
}
}
I know that PageIndex is of type “int?” so it can be null.
But I don’t really know why… If I have the “searchByPages” parameter set to true as you can see in code, I think it should never be null. What good is a search result if I don’t know on which page it was found?