We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Incorrect pagecount on Linux


I’m using Aspose Words 17.6 java version on Linux (Suse Enterprise Linux 11) using jdk 8 update 74.

When executing the following piece of code

    InputStream stream = TestUtils.loadInputStream("applications", "claims_EP14382314.docx");
    Document doc = new Document(stream);
    System.out.println(doc.getPageCount()); ;

Then I get the number 4 printed out.
When executing this on Windows, I get the correct number 2 as a result.

Executing the same code but with a different document also results in the wrong number of pages being returned

    InputStream stream = TestUtils.loadInputStream("applications", "CONTROL_DEVICE_EP16179606_Specification.odt");
    Document doc = new Document(stream);
    System.out.println(doc.getPageCount()); ;

This is printing out 7 where 6 is the expected answer.

Surpisingly enough for this document, the result on the same linux box is correct.

The two concerned documents are attached.

Could you please investigate both cases and provide a possible work around.
documents.zip (38.3 KB)

Many thanks.
This issue is a critical issue for our usage of the aspose words library.

Many thanks for having a look at it.



Thanks for your inquiry. I have tested the scenario with “claims_EP14382314.docx” and noticed that incorrect page count on Linux. I have logged a ticket WORDSJAVA-1651 in our issue tracking system for further investigation and rectification. We will notify you as soon as it is resolved.

Furthermore, in reference to “CONTROL_DEVICE_EP16179606_Specification.odt” document, Windows and Linux both returns 7 pages. However, you have stated that Linux box is correct. Does it mean you are getting 6 pages count on Linux?

I’m indeed getting 6 as pagecount.
I will confirm tomorrow.

With respect to pagecount being wrong on Linux this is a blocking issue for us. Is there anything we can do to increase priority of the issue.

Many thanks


Thanks for your feedback. Sure, we will log the issue accordingly.

We have shared your concern with our product team. Furthermore, in reference to any option to expedite the fix process, we have following three Paid support options as well in addition to free support. Purchase of Paid support increases issue precedence over normal support and development team starts investigating the issue on priority basis. Purchasing paid support will definitely raise your issue priority but resolution or hotfix is subject to the complexity and priority of issue.

Priority Support
Enterprise Support
Sponsored Support

If you have any query related to the Paid support please post in purchase forum. We will be more than happy to help you.

Hi Tilal,

Many thanks for the information. We are in the processing or procuring OEM license. I expect that this will cover support as well.

With respect to the pagecount for the odt document, my observation was incorrect. Indeed both on Linux and Windows the page count is wrong.

Thanks for keeping me informed about the progress of this ticket.

Kind regards


Hi Tilal,

By following the information provided here https://docs.aspose.com/display/wordsjava/How+to++Specify+True+Type+Fonts+Location,
I was able to solve the problem by copying the Windows True Type Fonts to a folder on Linux.

The problem with the ODF file remains both on Windows and on Linux. This however is not blocking for us anymore.

Many thanks for your support.



Thanks for your feedback. It is good to know that you have managed to resolve DOCX page count issue. We will close WORDSJAVA-1651 ticket.

However, we have logged a ticket WORDSNET-15860 in our issue tracking system to investigate the ODF page count issue. We will keep you updated about the issue resolution progress within this forum thread.


The issues you have found earlier (filed as WORDSNET-15860) have been fixed in this Aspose.Words for .NET 17.10 update and this Aspose.Words for Java 17.10 update.

Hi, I am using aspose-words 21.7 and I have the same issue as PatrickVB. When I run my app on windows, I got page number 14 but when I run it on lynix, the page number becomes 17. I tried to copy my windos Font folder to lynix and run my app using -DAspose.Cells APis, which did not help. Any other suggestions?

@zhishuaiz Your issue seems to be related to Aspose.Cells, so please ask the question in the appropriate support forum.