Hi,
I would like to know why does the DocumentVisitor visit the document in this order? For me, this is strange behavior. In the middle of paragraph, it visits the run from Text Box and then continue to visit runs from paragraph.
The document is attached.
Here is the code I used:
Document document = new Document(“2906_one_page.docx”);
document.accept(new DocumentVisitor() {
@Override
public int visitRun(Run run) throws Exception {
System.out.println(run.getText());
return super.visitRun(run);
}
@Override
public int visitShapeStart(Shape shape) throws Exception {
System.out.println("—Shape start—");
return super.visitShapeStart(shape);
}
@Override
public int visitShapeEnd(Shape shape) throws Exception {
System.out.println("—Shape end—");
return super.visitShapeEnd(shape);
}
});
And here is the example of the output:
This manual does not explain or discuss clinical surgical
—Shape start—
warning
—Shape end—
procedures. Therefore, the healthcare professional using
I’m using Aspose.Words 14.3.0.
Thanks,
Zeljko