getPagecount shows incorrect page number

Dear Team,

I am using Aspose latest version of java for document conversion . I am trying to get total number of pages using doc.getPageCount(), but it gives improper page count . I have attached doc with this post . Even i tried using of doc.getBuiltInDocumentProperties().getPages() still it shows in correct values. Am i doing anything wrong ?


If not, please suggest some ideas to identify to know whether it is huge document or not . Because we have a scenario that not to process the huge documents.

Hi Anbu,


Thanks for your inquiry.

While using the latest version of Aspose.Words for Java i.e. 11.0.0, I was unable to reproduce this issue on my side. Could you please double check and confirm which version of Aspose.Words are you currently using? Moreover, you can download the latest version of Aspose.Words for Java i.e. v11.0.0 from the following link:

I hope, this will help.

Best Regards,

Thanks for the reply .


Here is my problem. I am trying to convert HTML to DOC using Aspose as below

byte[] b = getArrayFromFile(“D:\Walden5.html”);
InputStream is = getStreamFromArray(b);
Document doc = new com.aspose.words.Document(is);

System.out.println(“PAGE COUNT::::::::;;” + doc.getPageCount());

Output : PAGE COUNT::::::::;; 60

But it is actually a 272 page document . What should i need to do ? Please suggest some ideas to get proper page size Or How can i differentiate whether the processing document is large document or not ?




Hi Anbu,


Thanks for your inquiry. Unfortunately, I was still unable to reproduce this issue on my side. I used the following simple code snippet which returned correct page count:
Document doc = new Document(“C:\temp\Walden5.doc);
System
.out.println(doc.getPageCount());
Could you please also attach Walden5.html file here for testing? We will investigate the issue further and provide you more information.

Best Regards,

I have attached html with this post .


Thanks,
Anbu

Hi Anbu,


Thanks for your inquiry. I managed to reproduce this issue on my side. I have logged this issue in our bug tracking system. Your request has also been linked to the appropriate issue and you will be notified as soon as it is resolved. Sorry for inconvenience.

Best Regards,

Any work around please ?


Thanks

Hi Anbu,


Thank you for inquiry. Please note that there is no guarantee that there is such a work around at the moment, you may need to wait for the original fix.

I’m currently evaluating Aspose.Words.
I need to extract each page of a document in several jpg files.
During my tests, I notice that in some cases getPageCount is wrong , for attached documents :

  • listing clients.docx have 2 pages but getPageCount return 1
  • hohoho.odt have 5 pages but getPageCount return 4
The last page is lost during my conversion.
I also tried to save these documents in PDF with Aspose, the last page is lost.
I have tried the Java and .NET 13.10.0 Version.


Hi Lopes,

Thanks for your inquiry.

While using the latest version of Aspose.Words for .NET i.e. 13.10.0, I was unable to reproduce this issue on my side. I would suggest you please upgrade to the latest version of Aspose.Words. You can download it from the following link:
http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/default.aspx

Please let me know if I can be of any further assistance.

Best regards,