I've just spent a bit of time exploring the interaction between first page header and "same as previous".
If you open the attached docx (renamed as zip) in Word 2007, you'll see that the
*2nd* section has a different first page.
However, looking at the WordML, this different second section appears in the first sectPr.
- Code: Select all
<w:body>
<w:p>
<w:r>
<w:t>Hello</w:t>
</w:r>
</w:p>
<w:p>
<w:r>
<w:br w:type="page"/>
</w:r>
</w:p>
<w:p/>
<w:p/>
<w:p>
<w:pPr>
<w:sectPr>
<w:headerReference w:type="default" r:id="rId7"/>
<w:footerReference w:type="default" r:id="rId8"/>
<w:headerReference w:type="first" r:id="rId9"/> <!-- note that this in the first sectPr -->
:
</w:sectPr>
</w:pPr>
</w:p>
<w:p>
<w:r>
<w:lastRenderedPageBreak/>
<w:t>2nd section</w:t>
</w:r>
</w:p>
<w:p/>
<w:p>
<w:r>
<w:br w:type="page"/>
</w:r>
</w:p>
<w:p>
<w:r>
<w:lastRenderedPageBreak/>
<w:t>s2 p2</w:t>
</w:r>
</w:p>
<w:p/>
<w:p/>
<w:p>
<w:pPr>
<w:sectPr>
<!-- no headerReference implies same as previous -->
<w:footerReference w:type="default" r:id="rId10"/>
<w:titlePg/> <!-- this specifies that any first page header/footer is actually used in this section -->
</w:sectPr>
</w:pPr>
</w:p>
From
http://www.documentinteropinitiative.or ... 1eb31.aspx :
[titlePg] specifies whether the parent section in this document shall have a different header and footer for its first page.
If the val attribute is set to true, then the parent section in the document shall use a first page header for the first page in the section. If the val attribute is set to false, then the first page in the parent section shall use the odd page header.
This setting does not affect the presence of even and odd page header on all sections, which is specified using the evenAndOddHeaders element (§2.10.1).
If this element is set to false and a first page header is specified , then it shall be ignored and only the odd page header shall be displayed. Conversely, if this element is set to true and the first page header type is omitted for the given section, then a blank header shall be created as needed (another header type shall not be used in its place).
If this element is omitted, then its value shall be assumed to be false.
I'll change docx4j to reflect this over the next day or so.