Hi, I have researched many reports of issues with this subject but none totally answer my question.
I have a simple test doc x that has a header/footer set on the first page followed by a section break where I set a new header/footer.
My understanding was that I can cycle sections and retrieve the heads & Feet in operation within each section but so far I get all heads & feet for the document at section 1 and none from section 2?
Can you help to understand what I am doing wrong?
Test Code segment:-
Iterator sectIter = this.ourAsposeInterface.getSections();
int sectNo = 1;
while (sectIter.hasNext()) {
Section aSection = sectIter.next();
System.out.println(“Section:” + sectNo);
System.out.println("Section has : " + + aSection.getHeadersFooters().getCount() + “Head/Feet”);
Iterator hfIter = aSection.getHeadersFooters().iterator();
int hf = 1;
while ( hfIter.hasNext() ) {
HeaderFooter anHF = hfIter.next();
System.out.println("Item: " + hf + " is " + HeaderFooterType.getName(anHF.getHeaderFooterType()) + “/” + anHF.getText());
hf++;
}
sectNo++;
}
output print:
Section:1
Section has : 5Head/Feet
Item: 1 is HEADER_EVEN/
Item: 2 is HEADER_PRIMARY/Opening header keyed at page 2 start
Item: 3 is FOOTER_PRIMARY/Opening footer keyed at page 2 start
Item: 4 is HEADER_FIRST/Opening One-Off header keyed at page 1 start
Item: 5 is FOOTER_FIRST/Opening One-Off footer keyed at page 1 start
Section:2
Section has : 0Head/Feet
I have added the docx file.
Appreciate your help
Thanks
Jan
word2016_headersfooters_page1_continuous.zip (17.9 KB)