aspose file tools*
The moose likes JSP and the fly likes To get total number of pages in Java script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "To get total number of pages in Java script" Watch "To get total number of pages in Java script" New topic
Author

To get total number of pages in Java script

N. Ganapathy
Greenhorn

Joined: Apr 16, 2012
Posts: 24


How to find the total number of pages in java script . Kindly let me know how to achieve it.

Thanks in advance.
Karn Kumar
Ranch Hand

Joined: Aug 06, 2009
Posts: 146

Can you elaborate what all you tried and how exactly you are trying so that we can understand your requirement ?

Is it simply to fetch total Count / Per Page records = total pages (Can be done by Ajax call to get DB call and return final total number of pages ) .
N. Ganapathy
Greenhorn

Joined: Apr 16, 2012
Posts: 24

Karn Kumar wrote:Can you elaborate what all you tried and how exactly you are trying so that we can understand your requirement ?

Is it simply to fetch total Count / Per Page records = total pages (Can be done by Ajax call to get DB call and return final total number of pages ) .


Dear Karn,

We are uploading a pdf file from client side. Actually we need to the find the total number of pages of the document based on which the user will decide whether the file has to be uploaded or not.

Instead passing it to the another jsp file and calculating the pagenumber, we need to handle this in the same java script file itself.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41812
    
  62
What are you counting? What constitutes a page?

Edit after seeing your reply: Javascript has no access to client - side files. You'll have to do this on the server.


Ping & DNS - my free Android networking tools app
Karn Kumar
Ranch Hand

Joined: Aug 06, 2009
Posts: 146

Are you sure that you will let user upload the file based on the Pages ? Or you have some some size limit for uploaded file ? If that is Size which matters then you look for javascript code , what Ulf suggested is good .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: To get total number of pages in Java script