SetPrintHeader(false); $pdfdoc->SetPrintFooter(false); $pdfdoc->AddPage(); $pdfdoc->Page1Header(); $pageTitle = "

TAX INVOICE

"; $pdfdoc->writeHTML($pageTitle, true, false, false, false, 'C'); $pdfdoc->SetTextColor(0); $shippingBillingBox = $this->element('pdf_shipping_billing_box'); $pdfdoc->writeHTML($shippingBillingBox, false); $LineItemTable = $this->element('line_items_table'); $pdfdoc->SetPrintHeader(true); $pdfdoc->pageContent($LineItemTable); $pdfdoc->lastPage(); if($docType == 'quote') { $commercialComments = '
'.$document['Quote']['commercial_comments'].'
'; $pdfdoc->pageContent($commercialComments); } $output_dir = '/Users/karlcordes/Sites/quotenik/app/webroot/pdf/'; $debuglevel = Configure::read('debug'); if($debuglevel == 0) { $output_dir = '/var/www/cakephp/app/webroot/pdf/'; } $pdfdoc->Output($output_dir.$filename, 'F'); echo "
Wrote: ".$output_dir.$filename; App::import('Vendor', 'xfpdi'); //$newpdf = new concat_pdf(); $newpdf = new XFPDI(); $newpdf->SetMargins(2, 2); $newpdf->setPrintHeader(false); $newpdf->setPrintFooter(false); $newpdf->setFiles(array($output_dir.$filename, $output_dir.'CMC_terms_and_conditions2006_A4.pdf')); $newpdf->concat(); $newpdf->Output($output_dir.$filename, "F"); //$pdfdoc->Output($output_dir = '/Users/karlcordes/Sites/quotenik/app/webroot/pdf/'.'example_060.pdf', 'F'); //echo $html->link($filename, '/pdf/'.$filename); ?>