We have a functionality in which we need to auto populate some Word Document templates. We are using Aspose.Words to achieve this functionality.
The original templates are 1 page long. However, when we auto populate some fields in the template, the document may extend to more than 1 page. After we are done with all the auto population, we need to determine the number of pages in the final document.
We have tried using document.PageCount and doc.BuiltInDocumentProperties.Pages properties, but they do not provide the correct results. We have also tried calling the UpdatePageLayout() before reading the above properties, but still the correct page count is not available.
Can you please let us know a way to read the page count ?
Thanks for your request. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is fixed.
I am inserting text in bookmarks and this could cause the text to continue to the next page.
But I always get page count = 1
Dim intPages As Integer = Doc.BuiltInDocumentProperties.Pages
My goal is to append one page to the end of the template doc, but we print duplex, so I want to add an extra page before we append the new page, so it doesn’t not print on the back of the orginal doc.
Thank you for additional information. I cannot reproduce the problem on my side. I tried with different value of bookmarks. Please try using the latest version of Aspose.Words (8.0.0).