GetStartPageIndex returns Wrong Page Number

Hi Team.

I am trying to get specify characters from a word document and return their page number. I am using the method:GetStartPageIndex();here is the code

and result

We can see the pagenumber is 30 obviously,however in document it is 26.

Could you take a look at the example? Is it something wrong with the document? Or is there a bug in aspose?7.3.docx (188.0 KB)

@Melancholy Please try loading your document with EditingLanguage.ChinesePRC. Default editing languages affect the document layout rules:

LoadOptions opt = new LoadOptions();
opt.LanguagePreferences.DefaultEditingLanguage = EditingLanguage.ChinesePRC;
Document doc = new Document(@"C:\Temp\in.docx", opt);
// ..................

Also, to determine nodes page indexes, Aspose.Words need to build document layout. To achieve this the fonts used in the original document must be available on the machine where the document is processed. If Aspose.Words cannot find the font used in the document, the font is substituted. This might lead into fonts mismatch and document layout differences due to the different fonts metrics and as a result incorrect page number detected by LayoutCollector. You can implement IWarningCallback to get notifications when font substitution is performed.
Please see our documentation to lean where Aspose.Words looks for fonts:
https://docs.aspose.com/words/net/specifying-truetype-fonts-location/