Hello,
I’m looking into an issue where page numbers are not being detected as expected in the DocumentVisitor. Attached you will find a sample program and a sample document that demonstrates the issues.
When I run the application, here is the output that I get:
*Visiting a Section
HEADER_EVEN FieldCode Results:
FieldCode Result: 4HEADER_PRIMARY FieldCode Results:
FieldCode Result: 5FOOTER_EVEN FieldCode Results:
FieldCode Result: 4FOOTER_PRIMARY FieldCode Results:
FieldCode Result: 5HEADER_FIRST FieldCode Results:
FieldCode Result: 1FOOTER_FIRST FieldCode Results:
FieldCode Result: 1*
What I expected was the following:
*Visiting a Section
HEADER_EVEN FieldCode Results:
FieldCode Result: 2HEADER_PRIMARY FieldCode Results:
FieldCode Result: 3FOOTER_EVEN FieldCode Results:
FieldCode Result: 2FOOTER_PRIMARY FieldCode Results:
FieldCode Result: 3HEADER_FIRST FieldCode Results:
FieldCode Result: 1FOOTER_FIRST FieldCode Results:
FieldCode Result: 1*
The fieldcode value/result corresponds with the page number entry in each header/footer entry. In the example document, there is only one section. Also, the section has odd, even, and first page headers and footers. It appears that it only correctly determines the page number for the page number on the first page’s header and footer. For the EVEN headers and footers, it seems that it gives me the largest even page number in the section. Likewise, for ODD headers and footers, it seems that it only gives me the largest ODD numbered page in the section.
My question is what is the correct behavior? I was assuming/expecting it to be as follows. For the ODD header/footer, I was expecting to get a value equal to the smallest ODD numbered page (excluding the first page, since that’s covered by HEADER_FIRST/FOOTER_FIRST). For the EVEN header/footer, I was expecting to get a value equal to the smallest EVEN numbered page.
Any advice, suggestions, questions are much appreciated! Please let me know if anything here is unclear and whether or not this is a defect or expected behavior.
I tested using Aspose 15.2.0.
The zip file is an Eclipse project that has an input folder with the test document that was used to describe the problem above.