Getting page number of word document is not working accurately in UNIX while working fine in windows

I am using the following code to get page number of a word doc it is working fine in windows but not in UNIX server. It is reporting wrong page numbers in UNIX

Document document = new Document(filePath);
LayoutCollector layoutCollector = new LayoutCollector(doc);
NodeCollection paragraphNodes = document.getChildNodes(NodeType.Paragraph, true);
for (Node node:paragraphNodes)
{
    if (node.getType == NodeType.PARAGRAPH)
    {
        int pageNumber = layoutCollector.getStartPageIndex(node);
        System.out.println(pageNumber);
    }

How can i fix this issue?

@chowdarypradeep.ch Most likely the problem in UNIX environment occurs because the fonts used in the source document are not available in the environment where the document is processed. As you may know MS Word documents are flow documents and does not contain any information about page layout. The consumer applications reflow the content into pages on the fly, so does Aspose.Words. To build an accurate document layout the fonts are required. If Aspose.Words cannot find the fonts used in the document the fonts are substituted . This might lead into the layout difference, since substitution fonts might have different font metrics. In turn, this might lead to incorrect page numbers detection. You can implement IWarningCallback to get a notification when font substitution is performed.
The following articles can be useful for you:
https://docs.aspose.com/words/java/specify-truetype-fonts-location/
https://docs.aspose.com/words/java/install-truetype-fonts-on-linux/
So to resolve the problem you should either install or provide the fonts required to render the document.