pdf-extraction

Counting the pages in a PDF file

I know of several tools/libraries that can do this but I want to know if this is possible with just opening up the file as a text file and looking for a keyword. ...