25 lines
338 B
PHP
Executable file
25 lines
338 B
PHP
Executable file
<?php
|
|
|
|
App::import('Vendor','tcpdf/tcpdf');
|
|
App::import('Vendor', 'fpdi/fpdi');
|
|
/* Count pages of the PDF attachments using FPDI */
|
|
|
|
|
|
class PageCounter extends FPDI {
|
|
|
|
function count($file) {
|
|
$pdf = new FPDI();
|
|
|
|
$count = $pdf->setSourceFile($file);
|
|
if(is_numeric($count)) {
|
|
return $count;
|
|
}
|
|
else {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
?>
|