Can't count pages count in word document. IDocumentInfo.PagesCount returns wrong value

I’m trying to get pages amount in word (.docx) document using sample that is shown on the official site: Get document info | Documentation.
For each document I’w tried I receive fewer pages that it really contains.
Document:
Vdjfhvbjdhfvbdjhfvjdhfbv.docx (16,6 КБ)

Code:
using (Converter converter = new Converter(“C:\path\Desktop\Vdjfhvbjdhfvbdjhfvjdhfbv.docx”))
{
IDocumentInfo info = converter.GetDocumentInfo();
WordProcessingDocumentInfo docInfo = (WordProcessingDocumentInfo)info;

Console.WriteLine("Pages count: {0}", docInfo.PagesCount);

}

Lib version:
GroupDocs.Conversion 24.2.0

1 Like

@Nektarinchik

It looks like you are evaluating the API in trial mode (without license). Please note that there are some trial limitations. However, you can avail a temporary license. A temporary license is just a time -restricted full license.

1 Like