Calculation of page number defers in Linux machine compare to Windows machine

Hi, I am using below code to find out the page number of particular node. But I see different results when I deploy my service (which has code to calculate page number for a particular node) in Linux container.

LayoutCollector _collector = new LayoutCollector(userDocument);
_collector.GetStartPageIndex(currentNode)

One of the reasons for above maybe because of Font substitution that is happening if the fonts of the user document is not present in Linux container, I did try to manage creating the fonts with same size/style of that of windows fonts present in user document and deployed those fonts with the same font name in Linux container and set the font source. Now I don’t see the Font Substitution error but still the page number issue is not fixed.

Could you please help us to know if this issue is common with the Linux environment and what would be the workaround for this?

I am using the Aspose version 22.7.0 and would like to know the options on how we can fix this page number issue that i am seeing with Linux container. Thanks.

@chetanrajakumar2024 You should note that MS Word documents are flow by their nature and does not have “page” concept. The consumer applications reflows the document content into pages on the fly. So t detect page indexes of nodes Aspose.Words also builds the document layout. You are right the problem you have described in most cases occurs because the fonts used in your input document are not available on the machine where document is processed. The fonts are required to build document layout. 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 detection. You can implement IWarningCallback to get notifications when font substitution is performed.
Please see our documentation to learn where Aspose.Words looks for fonts:
https://docs.aspose.com/words/net/specifying-truetype-fonts-location/

You should also note that the same font can have different versions, that also might cause the difference in layout.