header background

Topics: Developer Forum
Oct 23, 2012 at 12:22 PM
Edited Oct 23, 2012 at 1:05 PM

I'm trying this code:


$objDrawing = new PHPExcel_Worksheet_HeaderFooterDrawing();
$objDrawing->setName('PHPExcel logo');
$objDrawing->setDescription('PHPExcel logo');

$objPHPExcel->getActiveSheet()->getHeaderFooter()->addImage($objDrawing, PHPExcel_Worksheet_HeaderFooter::IMAGE_HEADER_LEFT);



I tried every imaginable tweak and failed.

Please somebody help!, where do I go wrong?

I'm using excel 2010



Oct 23, 2012 at 10:00 PM

Not sure why you're trying to set a cell coordinate for a header image, but /Tests/04printing.php successfully places that image in the left part of the print heading.

Oct 24, 2012 at 2:14 AM
Edited Oct 24, 2012 at 3:11 AM

yes, you are right,

04printing.php works fine, that solved me half of the problem, thank you very mucha.

the other half is because when I use the same example to produce pdf the background image does not show,

I'm using MPDF54, tcpdf, dompdf,

at least tcpdf respond to $objPHPExcel->getActiveSheet()->getPageMargins()->setTop(2);

Oct 24, 2012 at 5:52 AM

okay, I realize that your script does not support header footer to pdf