Skip to content
This repository was archived by the owner on Jan 2, 2019. It is now read-only.

Added 'FIRST' location for different headers and footers images #320

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

alexandreprado
Copy link

I spent many days trying to set two different images for headers and footers when using setDifferentFirst(true) with no success.

I realized then there was no location set for the first image sections in Worksheet/HeaderFooter.php class. After unzipping an excel file, i just added the id's set by msoffice to the project.

Now it has the ability to set a different image to the first header and footer.

Usage:

$objPHPExcel->getActiveSheet()->getHeaderFooter()->setDifferentFirst(true);

// for regular H&F
$objPHPExcel->getActiveSheet()->getHeaderFooter()->addImage($objDrawing, PHPExcel_Worksheet_HeaderFooter::IMAGE_HEADER_LEFT);

// for first H&F
$objPHPExcel->getActiveSheet()->getHeaderFooter()->addImage($objDrawing, PHPExcel_Worksheet_HeaderFooter::IMAGE_HEADER_LEFT_FIRST);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants