Headers and footers in Word docs
mnelson4 opened this issue · comments
Looks like I might not need a separate header file etc. See https://stackoverflow.com/questions/13340216/html-generated-microsoft-word-document-with-header-footer-and-watermark
Using that technique kinda works, but the HTML is really confusing (requires a table and some extra divs).
But now I'm trying to generate a more complex HTML header but getting errors...
The word doc won't display my hacked-in-images. I think I should instead:
- in an experimental branch
- add simple field for header and footer to the design template
- make sure images placed in there are visible in the word doc
- make sure the headers don't disappear when saving as docx
- then try copying the more complex HTML into those fields and see if it appears
- have header or footer reach to the end of the page
- have header only appear on first page (I supposed
mso-first-header: ID
would work but didn't; may need to monkey with sections like provided template does) - maybe have options for "first page header", "subsequent headers", and background image;
- switch those fields to be WYSIWYG or block editors: https://developer.wordpress.org/reference/functions/wp_editor/ and https://developer.wordpress.org/block-editor/how-to-guides/platform/custom-block-editor/tutorial/
handy link for all MSO elements: https://gist.github.com/p3t3r67x0/ac9d052595b406d5a5c1
Closing until there's some feedback on this