Is there a way to have a different header logo for the 1st page in a document and different for the 2nd page?
I thought that changing the header data between adding page
Just for the record, if someone has the same problem in the future and can use Zend_Pdf
:
// $filename is the final filename with path to save the generated PDF
$dir = dirname($filename);
$base = basename($filename);
$page1 = $dir . DIRECTORY_SEPARATOR . "tmp_1_" . $base;
$page2 = $dir . DIRECTORY_SEPARATOR . "tmp_2_" . $base;
//creates 1st page with TCPDF and saves to filesystem with filename $page1
$this->generateInvoicePage1($html_1, $page1);
//creates 2nd page with TCPDF and saves to filesystem with filename $page2
$this->generateInvoicePage2($html_2, $page2);
$pdf1 = Zend_Pdf::load($page1);
$pdf2 = Zend_Pdf::load($page2);
foreach ($pdf2->pages as $page) {
$pdf1->pages[] = clone($page);
}
$pdf1->save($filename);
unlink($page1);
unlink($page2);