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

Free Support Forum - aspose.com

Another wrong pagecount

Hi there,

please check the page count of the attached document. Aspose Words for .Net 17.1.0. reports 15 pages.

MS Word 2010 shows 16.


Hi there,

Thanks for your inquiry. Please note that Aspose.Words mimics the same behavior as MS Word does. The Document.PageCount property builds page layout of document and return page's count. If you save the document to fixed page format e.g. Pdf using MS Word, the page count of output document will be 15.

The second last page of document have section break (page break) and last two pages are empty. Could you please share about your use case in which you are getting page count? We will then provide you more information about your query.

Hi Tahir,

ist quite complicated. We try to merge word documents and prepare them for duplex printing.

But there is a problem where adding a section changes the document layout and the last page collapses.

In the attached document it’s as follows:

Word, PDF and Aspose report 15 pages.

So we add a new section to get a blank page. After that word shows 16 pages for the generated document as expected - Aspose and PDF Page count is still 15 because the layout changed). Printing the document from word also delivers 15.

So theres two problems:

Word counts differently when using the document view “print preview” and the actual print preview - and that’s nuts.

And: Adding a section to a document may change the document layout thus not changing the page count - funky.

But as i see it - it seems to be a Microsoft problem - so thanks for now. I will figure a way around…

Hi there,

Thanks for your inquiry. Please insert simple page break instead of section break at the end of document. Moreover, please register hyphenation dictionary to your language as shared in following documentation link. Hope this helps you.

How to Hyphenate Words of Specified Languages