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

Free Support Forum - aspose.com

Iterating over PageCollection does not match Pages.Count


I must be doing something wrong, as this doesn’t make any sense.

Document pdfDocument = new Document(“source-pdf.pdf”);
Console.WriteLine("# of pages: " + pdfDocument.Pages.Count);
foreach(Page page in pdfDocument.Pages)


# of pages: 30

Why does this over loop only 4 times if there are 30 pages?

Sadly, this is a sensitive document and I cannot share it.

I can confirm the PDF does have 30 pages when opening it in Acrobat.


Ahhhh … i think this might be due to having a trial license for testing. Is this accurate?

Hi Andrew,

Thanks for using our API’s.

Yes you are correct. There are some limitations when using the API in trial mode. However in order to test the API without any limitation, you may consider requesting a 30 days temporary license by following instructions specified over Get a temporary license