We use bookmark in the document to identify certain contents and wrap it up within content control.
In a particular use case where a bookmark is added just before the a normal table at the end of the document.
The Bookmark(hidden bookmark) doesn’t show up on downloading the document, even after checked a hidden bookmark checkbox.
When I initialize the org.aspose.word.Document instance with the same file and try to find the bookmarks, I get all as expected. but after downloading the document, bookmark just does not show up. What could be the possible reason behind it?
Document doc = new Document(in);
//Checking for bookmark deletion
logger.info(String.format(“Bookmarks present in the template file for document ID: %s”,
for (com.aspose.words.Bookmark bookmark : doc.getRange().getBookmarks())
“End of list of Bookmarks present in the template file for document ID : %s”,
//Download the document.
outputStream = response.getOutputStream();
byte bytes = new byte[4 * 1024];
while ((read = inputStream.read(bytes)) != -1)
outputStream.write(bytes, 0, read);
If needed I can send the document file to reproduce the issue.
I would appreciate any help.