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

Free Support Forum - aspose.com

Count number of pages

How can i know the no. of pages, when i open a document using Apsoe.Word?

This message was posted using Email2Forum by Merit.


Thanks for your interest in Aspose.Words. Aspose.Words document represents content and formatting of a document, not its layout into lines and pages. This feature is called pagination and it is not released yet. Please see FAQ for more information.

You can try using BuildInDocumentProperties.Pages to get count of pages.

But this count could be not actual.

Best regards.

Thanks for the quick replay.

Actually I have a requirement, where i have to merge Two documents say Doc1 and Doc2. And while doing this, i want to skip the first page of Doc1.

Since these two douments are supposed to come from outside, so we can’t expect to have a section break.

I just want to skip the first page from Doc1.

I have a code where i can merge two documents.




Thank you for clarification.

Currently this task can be solved only using assumptions on document structure and layout. If you don’t steadily have section breaks or page breaks at the points you need to cut then you can try to assume anything else. We don’t see your documents and cannot guess what could be optimal and safe. If you’d like us to advise please attach some of them. Anyway you cannot cut the first page in general case due to considerations pointed by my colleague.