Hi,
I’ve encountered several customer documents which are causing an NPE in LayoutCollector.getStartPageIndex(). I have managed to reproduce this using Aspose Words 17.6. A similar exception also occurs in getEndPageIndex().
Please find attached a document to recreate the issue using the following code:
License license = new License();
license.setLicense(“Aspose.Total.Java.lic”);
Document document = new Document(“conditional field.docx”);
LayoutCollector layoutCollector = new LayoutCollector(document);
for (Node node : (Iterable) document.getChildNodes(NodeType.PARAGRAPH, true)) {
if (node.getAncestor(NodeType.HEADER_FOOTER) == null) {
layoutCollector.getStartPageIndex(node);
layoutCollector.getEndPageIndex(node);
}
}
Cheers,
Simon