• Count page numbers in pdf's?

    By Steve Cochrane 1 decade ago

    Hello!

    As an added property, how about counting pages for pdf's?  For example, have a limit of 50 pages and have the uploader allow as many files as the user wants, as long as the total pages don't go over 50.

    Any ideas?

    Thanks!

    Steve in NYC

    • That should not be part of a file uploader control

      By F. Kranenburg 1 decade ago

      The file uploader control is very generic and usable for all kinds of files. I would like to keep it that way.

      I don't think it is possible too, your request would require additional PDF reader libraries (java) to read the count of pages. These libraries can only be used and called from server side. The file uploader uploads the files from the browser (client side, using javascript, not SSJS), the limit check is peformed by the browser itself. 

      So the only way to accomplish this is by checking for all the pages AFTER the files are uploaded and saved on the server. But this goes beyond the scope of the file uploader. I think you should create your own custom validator for this.