The simple answer is: "It is not possible"
Having said that, here is a page on the PHP.net documentation that says the following:
http://us3.php.net/pdf
In other words, you would simply have to look for the "/Count ", and the number of pages will be right in front of it.
For example:
So Once you find the "/Type /Pages" inside the text of your PDF file, the "/Count " that follows it will have the number of pages in it.