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

Free Support Forum - aspose.com

Wrong page number using getPageCount

Hello,
Firstly I use aspose.words 16.4.0 with a supported license.
I try to extract the page count of a Word document, but I encounter a problem on Linux.
My Word document has 28 pages, Windows says also 28 pages, but Linux (RedHat) says 30 pages.
I provide the file in attachment.

This is the extraction code:
{code}
com.aspose.words.Document wordDocument = new com.aspose.words.Document(is);
return "Pages: "+wordDocument.getPageCount();
{/code}

I tried to use your example PageSplitter to analyze each page content (see https://github.com/aspose-words/Aspose.Words-for-Java/blob/5f6d55dbffc44e33d144525c434c875d75e3d002/Examples/src/main/java/com/aspose/words/examples/loading_saving/PageSplitter.java).

This is the PageSplitter call:
{code}
PageSplitter.SplitDocumentToPages(myWordFile);
{/code}

In Windows, I have 28 created files, but in Linux, I have more than 30 created files (the layout is different compared to Windows in some pages), and some files contain the content on the first page and a blank page (the file 31 to the last contains only a blank page).

Maybe it is coming from margin.

Can you please help us on this problem?

Regards.

Hi Mantovan,


Thanks for your inquiry.

While using the latest version of Aspose.Words i.e. 16.5.0, we managed to reproduce this issue on our end. We have logged this issue in our bug tracking system. The ID of this issue is WORDSNET-13880. Your thread has also been linked to the appropriate issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,

Hi Mantovan,


Regarding WORDSNET-13880, most likely you are missing some fonts on your Linux machine. Could you please convert the document to XPS format using Aspose.Words for Java on your Linux machine and attach it here for our reference? After we get such XPS, we will be able to tell exactly what fonts you need to install to fix this issue.

Best regards,

Hi support,

Do you have any new about this issue ?

Regards,

Florian Mélot

Hi Florian,


Thanks for your inquiry. Please check my previous post:
Awais:
Regarding WORDSNET-13880, most likely you are missing some fonts on your Linux machine. Could you please convert the document to XPS format using Aspose.Words for Java on your Linux machine and attach it here for our reference? After we get such XPS, we will be able to tell exactly what fonts you need to install to fix this issue.
We are waiting for your further input on this topic. Please share the required information for further proceedings. Thanks for your cooperation.

Best regards,

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