We have a functionality in which we need to auto populate some Word Document templates. We are using Apsose.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 ?