Hi,
Highlighted paragraph in the screenshot is skipped by your Document Visitor.
If you run the code below you will get:
PARAGRAPH START
PARAGRAPH END
TABLE END
PARAGRAPH START
FIELD START
PARAGRAPH END
I expected it to be:
PARAGRAPH START
PARAGRAPH END
TABLE END
PARAGRAPH START
PARAGRAPH END
PARAGRAPH START
FIELD START
PARAGRAPH END
Can you please check this out?
Thanks,
Zeljko
Code:
public void paragraphTest() throws Exception {
Document document = new Document("Test.rtf");
document.accept(new DocumentVisitor() {
@Override
public int visitParagraphEnd(Paragraph paragraph) throws Exception {
System.out.println("PARAGRAPH END");
return super.visitParagraphEnd(paragraph);
}
public int visitParagraphStart(Paragraph paragraph) throws Exception {
System.out.println("PARAGRAPH START");
return super.visitParagraphStart(paragraph);
}
public int visitTableEnd(Table table) throws Exception {
System.out.println("TABLE END");
return super.visitTableEnd(table);
}
public int visitFieldStart(FieldStart field) throws Exception {
System.out.println("FIELD START");
return super.visitFieldStart(field);
}
});
}
Additional information:
If you modify the document (for example: delete last three pages) the above mentioned paragraph will be visited.