Hi,
Highlighted paragraph in the screenshot is skipped by your Document Visitor. If you run the code below you will get:
..
TABLE START
PARAGRAPH START
PARAGRAPH START
PARAGRAPH END
PARAGRAPH START
PARAGRAPH END
TABLE END
PARAGRAPH START
BOOKMARK START
BOOKMARK START
PARAGRAPH END
..
But it should be:
..
TABLE START
PARAGRAPH START
PARAGRAPH START
PARAGRAPH END
PARAGRAPH START
PARAGRAPH END
TABLE END
PARAGRAPH START
PARAGRAPH END
PARAGRAPH START
BOOKMARK START
BOOKMARK START
PARAGRAPH END
..
Could you please check this out?
Thanks,
Zeljko
code:
public void section() throws Exception {
Document document = new Document("Test.doc");
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 visitTableStart(Table table) throws Exception {
System.out.println("TABLE START");
return super.visitTableEnd(table);
}
public int visitBookmarkStart(BookmarkStart bookmark) throws Exception {
System.out.println("BOOKMARK START");
return super.visitBookmarkStart(bookmark);
}
public int visitBookmarkEnd(BookmarkEnd bookmark) throws Exception {
System.out.println("BOOKMARK END");
return super.visitBookmarkEnd(bookmark);
}
});
}
code:
public void section() throws Exception {
Document document = new Document("Test.doc");
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 visitTableStart(Table table) throws Exception {
System.out.println("TABLE START");
return super.visitTableEnd(table);
}
public int visitBookmarkStart(BookmarkStart bookmark) throws Exception {
System.out.println("BOOKMARK START");
return super.visitBookmarkStart(bookmark);
}
public int visitBookmarkEnd(BookmarkEnd bookmark) throws Exception {
System.out.println("BOOKMARK END");
return super.visitBookmarkEnd(bookmark);
}
});
}