Skip to content

Conversation

oleibman
Copy link
Collaborator

@oleibman oleibman commented Aug 5, 2025

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.

This is:

  • a bugfix
  • a new feature
  • refactoring
  • additional unit tests

Checklist:

Fix PHPOffice#484. Fix PHPOffice#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.
@oleibman oleibman enabled auto-merge August 7, 2025 05:26
@oleibman oleibman added this pull request to the merge queue Aug 7, 2025
Merged via the queue into PHPOffice:master with commit 8d8bc23 Aug 7, 2025
13 of 14 checks passed
@oleibman oleibman deleted the issue484 branch August 7, 2025 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Image in FirstHeader gets lost during writing Setting header image on only first page

1 participant