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
BOOKMARK START
BOOKMARK START
PARAGRAPH END
But it should be:
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.pdf.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 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 START");
return super.visitBookmarkEnd(bookmark);
}
});