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

Free Support Forum - aspose.com

Count pdf document pages on client side


I have a ASP.NET project where I am required to validate a pdf (and also word if possible) page count before uploading to server.
Is it possible to get an Aspose object for an existing file client side and check the number of pages?

Hi Avi,

Thanks for contacting support.

As per my understanding, you need to get the number of pages inside PDF file. If so is the case, then please follow the instructions specified over Get Number of Pages in a PDF File

Thanks, the question is if it could be done CLIENT SIDE on a webpage (i.e using javascript for example).

Hi Avi,

In order to get the page count, the file first needs to be loaded/read by our API, so that it can determine the page count information. So you may consider implementing some solution to upload files from client side and once the file is loaded, you can perform page count and show the resultant to customer (if necessary).

Or you may consider using ViewerApp of our sister company named GroupDocs to load and display PDF (other file formats as well) on customer side and even you can show the page count. This way all the processing will be performed on our server side.