Does anyone know how I can count the number of pages in a pdf file using php? Thanks!
exec('pdftops ' . $filename . ' - | grep showpage | wc -l', $output);
See as well the similar question and answers:
Count the number of pages in a PDF in only PHP