Using the java version of Aspose.Words…
I have a Word 2000 document that contains many pages, all created using the Insert… Page Break option in Word.
I assumed that the following code would be valid:
// get the first section (should be the whole document)
Section firstSection = srcDocument.getFirstSection();
processFirstPage(firstSection);
// process each section; one page per work details
Section section = firstSection;
while ((section = (Section)section.getNextSibling()) != null)
{
processWorkPage(section);
}
However the entire document is being returned in the first section node and the processWorkPage within the loop is never visited.
Is there a way (without using the Visitor pattern) to access each page as a node in its own right, or is there a way to detect the page breaks when processing paragraphs within the body section?
Thanks
John