I used the above code which solves the problem with regex and it works, but it is rather slow. It reads the entire file to determine the number of pages.
I used it in a web application, and the pages sometimes displayed 20 or 30 PDF files at a time, in which case the page load time was from a few seconds to almost a minute due to the page counting method.
I donβt know if third-party libraries will be much better, I hope they are, and I have successfully used pdflib in other scripts.
user264631 Feb 02 '10 at 19:07 2010-02-02 19:07
source share