This is a follow on question from:
which I thought had solved the problem.
Unfortunately, the issue I have run in to is that I am dynamically generating content within the middle of the PDF which means I do not know what page number the last pages within the PDF will be - but I DO need to be able to specify a set header.
So for example:
Page 1: Cover page header
Page 2: Index page header
Page 3: Introduction header
Pages 4 -> n: Content pages header
Page n+1: Summary header
Page n+2: Contact details header
I thought it may be possible to use Page Groups to achieve this - however, the only output I seem to be able to get from Page Groups is the number of pages within them, rather than an actual page group ID. If I had an ID, then I could substitute $page_group for $page in the previous example, and then do:
Page group 1: Cover page header
Page group 2: Index page header
Page group 3: Introduction header
Page group 4: Content pages header
Page group 5: Summary header
Page group 6: Contact details header
Has anybody managed to successfully do this?