<?

$output_dir = Configure::read('pdf_directory');

$pagecount = $pdfdoc->setSourceFile($output_dir.'CMC_terms_and_conditions2006_A4.pdf');
for ($i = 1; $i <= $pagecount; $i++) { //Not really necessary for a 1 page T&C PDF, but handles future longer ones.
    $tplidx = $pdfdoc->ImportPage($i);
    $pdfdoc->AddPage();
    $pdfdoc->useTemplate($tplidx);
}

$pdfdoc->lastPage();
$pdfdoc->Output($output_dir.$filename, "F");
?>
