• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

To get total number of pages in Java script

 
N. Ganapathy
Greenhorn
Posts: 25
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 153
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 25
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Karn Kumar
Ranch Hand
Posts: 153
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic