We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Fail to get bookmark after a table in Aspose.Words for Java

Hi Support,


In the attached document, there is a table. I added a bookmark named “test_bookmark_1” before the table. I also added a bookmark named “test_bookmark_2”. I can only get “test_bookmark_1” but not test_bookmark_2” from the bookmark collection using the logic below.

BookmarkCollection bookmarks = srcDoc.getRange().getBookmarks();
for (Bookmark bm : bookmarks)
{
System.out.println("Found Bookmark : Name - " + bm.getName());
}
System.out.println("Number of bookmarks: " + bookmarks.getCount());

Can you confirm if it is a bug? If it is, Is there any workaround for this issue? Thanks.

Alan

Hi

Thank you for reporting this problem to us. I managed to reproduce it on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.

Best regards,

Hi,


FYI.

I have narrowed down the issue. All the subsequent bookmarks cannot be retrieved if there is a bookmark at the end of a table row.

Regards,
Alan

Hi Alan,

Thank you for additional information. Yes, you are right, In MS Word documents BookmarkEnd and BookmarkStart nodes can be placed within a table (between cells). But in Aspose.Words DOM they can be children of Paragraphs only. I suppose that is why the problem occurs.

Best regards,

The issues you have found earlier (filed as WORDSNET-4485) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.