You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix#484. Fix#1318. Both went stale a long time ago. The images can currently specify their location as Left, Center, or Right. However, they also need to specify their type - first page, even pages, or odd pages (which is what is used when neither of the others is applicable). This is accomplished by adding 18 new constants to `Worksheet\HeaderFooter`, any of which can be specified as the second argument to `HeaderFooter::addImage`. Somewhat surprisingly, no changes are required to Xlsx Writer or Reader.
Xls Reader and Writer support header/footer, but do not support using images in them. No other readers nor writers support header/footer.
->setOddFooter('&L&B' . $spreadsheet->getProperties()->getTitle() . '&RPage &P of &N');
764
764
```
765
765
766
+
<aid='setDifferent'></a>
767
+
Notice the use of `oddHeader/Footer` above. This is, by default, the header used on all pages, not just the odd-numbered pages. You can specify a different header/footer for the first page and/or for even-numbered pages.
768
+
```php
769
+
$spreadsheet->getActiveSheet()->getHeaderFooter()
770
+
->setDifferentFirst(true);
771
+
// then as above except setFirstHeader/Footer rather than Odd
772
+
$spreadsheet->getActiveSheet()->getHeaderFooter()
773
+
->setDifferentOddEven(true);
774
+
// then as above except setEvenHeader/Footer rather than Odd
775
+
```
776
+
766
777
Substitution and formatting codes (starting with &) can be used inside
767
778
headers and footers. There is no required order in which these codes
768
779
must appear.
@@ -792,7 +803,7 @@ Code | Meaning
792
803
`&C` | Code for "center section". When two or more occurrences of this section marker exist, the contents from all markers are concatenated, in the order of appearance, and placed into the center section.
793
804
`&D` | Code for "date"
794
805
`&T` | Code for "time"
795
-
`&G` | Code for "picture as background" - Please make sure to add the image to the header/footer (see Tip for picture)
806
+
`&G` | Code for "picture as background" - Please make sure to add the image to the header/footer (see [Tip for picture](#Tip-for-picture))
796
807
`&U` | Code for "text single underline"
797
808
`&E` | Code for "double underline"
798
809
`&R` | Code for "right section". When two or more occurrences of this section marker exist, the contents from all markers are concatenated, in the order of appearance, and placed into the right section.
@@ -835,6 +846,7 @@ users may find it easier to rename test.xlsx to test.zip, unzip it, and
835
846
inspect directly the contents of the relevant xl/worksheets/sheetX.xml
0 commit comments