I’m trying to get the layout information for OfficeMath nodes using the LayoutCollector and LayoutEnumerator classes. This works for regular runs, paragraphs etc, but for most (but not all) OfficeMath nodes it fails. Specifically, in the example code below, the call to collector.getEntity(node)
returns null.
OfficeMath node = (OfficeMath) doc.getChildNodes(NodeType.OFFICE_MATH, true).get(0);
LayoutCollector collector = new LayoutCollector(doc);
Object entity = collector.getEntity(node);
LayoutEnumerator enumerator = new LayoutEnumerator(doc);
enumerator.setCurrent(entity);
System.out.println(enumerator.getRectangle());
Attaching simplest example document I could create which exhibits the problem. Using v21.8 of Aspose Words.
office_math_example.docx (12.9 KB)