Home / Admin / pdf page count
Duplicate Snippet

Embed Snippet on Your Site

pdf page count

pdf page count

George Nikfard
<10
Code Preview
php
<?php
<?php
function count_pdf_pages($pdfname) {
  $pdftext = file_get_contents($pdfname);
  $num = preg_match_all("/\/Page\W/", $pdftext, $dummy);
  return $num;
}
$pdfname = 'example.pdf'; // Put your PDF path
$pages = count_pdf_pages($pdfname);
echo $pages;
?>

Comments

Add a Comment