Get Bookmarks from ODT Word Document InputStream using Java | Extract Bookmarked Data

@awais.hafeez

we are having odt data in database as a blob. We retrieved data from blob as inputstream and creating new Document using Aspose 20.5 jar. Here is the java code snippet.
Document doc = new Document(inputStream);
doc.save("<FILE_NAME>.doc");

The issue here is we are unable to get bookmarks in output document.
can you please help me on this.

I’ve explored Aspose forums but dint find relevant code for our requirement.

@rboyina,

Please save the InputStream of ODT to disk, ZIP the ODT file and attach it here for testing. Generally, you should be able to get Bookmarks from ODT file by using the following Java code:

Document doc = new Document("input.odt");
Bookmark bookmark = doc.getRange().getBookmarks().get("Bookmark1");
System.out.println(bookmark.getText());

Please also provide a screenshot highlighting the area (or bookmarked element) in ODT file that you want to get by using Aspose.Words here for our reference.