Paragraph skipped

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);
        }
    });

Hi Zeljko,

Thanks for your inquiry. Please call Document.ensureMinimum method after loading the document into Aspose.Words DOM to fix this issue.

Document document = new Document(MyDir + "Test.pdf.doc");
document.ensureMinimum();

We have logged this problem in our issue tracking system as WORDSNET-13752. You will be notified via this forum thread once this issue is resolved. We apologize for your inconvenience.