Adding image to header

Topics: Developer Forum
Aug 1, 2014 at 8:07 AM
Hello, I'm having problems in adding an image to an excel header using PHPExcel... Ordinary text gets added without any problems but header simply doesn't show. When i look at the XML structure of the created of my xls file I can see that the added image is present in the media folder and that is properly referenced in XML using legacyDrawingHF tag but I can't see it when I open the file in Excel. This is my code:
        $this->objPHPExcel->setActiveSheetIndex(0);

        $objDrawing = new PHPExcel_Worksheet_HeaderFooterDrawing();
        $objDrawing->setName('Name');
        $objDrawing->setDescription('Description');
        $objDrawing->setPath("path");
        $objDrawing->setResizeProportional(true);


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

        $objWriter = PHPExcel_IOFactory::createWriter($this->objPHPExcel, 'Excel2007');

        $objWriter->save('php://output');
Any suggestion what the problem might be?