Forum How do I...?

Global header on all pages except first page of each chapter

dpassera
Apologies that this is repeating a question, but my searches didn't find an answer that worked. I hope I am just overlooking something simple. Thank you to anyone who can help.

Goal:
- Generate a PDF with 5 chapters
- Each page has a global header EXCEPT for the first page of each chapter, which has NO header.
- Each page has a global footer

I'm not having any issues with displaying the footer on all pages, nor with displaying the header on all pages.

However, when I attempt to suppress the header on the first page of each chapter, the best I can manage is suppressing the header on the first page of the document.

I'm attaching a stripped-down HTML file that matches the basic structure of my production file. I have removed CSS styles because whatever I'm doing isn't working, and I don't want to confuse with a rat's nest of not functioning princexml styles. I've tried a variety of combinations of page breaking, page groups, etc., based on other forum posts and AI responses. I'm hopeful that if someone can provide the correct styles for this simple page + any structural adjustments, I can expand from there.


Unfortunately, I cannot share the actual file without major obfuscation. If necessary, I can do that, but it will take some time.

Thank you, sincerely, for any assistance.

  1. debug.html17.8 kB
  2. debug.pdf48.1 kB
csant
You forgot to include styling in the debug example you uploaded.

The documentation chapter on Named Pages shows in its last example exactly what you are looking for: you need to create page groups, and style the headers of the first-of-group in a different manner.

But I think it should be easier to find...
dpassera
Thank you for this. Helped me see that I was looking at docs and how-tos based on pre-v16 releases. In reading the release notes for 16, the behavior of page:first changed to always reference the first page of the *document* rather than the first page of a page group. I totally missed that.

Everything is now working as expected. I really, really appreciate your help. Thank you.
csant
I was looking at docs and how-tos based on pre-v16 releases


These docs should have a note at the bottom, warning that it is not the latest version - was it not present?
dpassera
I honestly can't remember. I was using Google and Claude to help me find examples of what I was trying to do. Some examples were on this site, some were stack overflow, some were generated by AI. I wasn't checking version numbers. My fault.