Hi,
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",
fileId));
for (com.aspose.words.Bookmark bookmark : doc.getRange().getBookmarks())
{
logger.info(bookmark.getName());
}
logger.info(String.format(
"End of list of Bookmarks present in the template file for document ID : %s",
fileId));
//Some code
//Download the document.
response.setCharacterEncoding("UTF-8");
outputStream = response.getOutputStream();
byte[] bytes = new byte[4 * 1024];
int read;
if (inputStream.markSupported())
inputStream.reset();
while ((read = inputStream.read(bytes)) != -1)
{
outputStream.write(bytes, 0, read);
}
outputStream.flush();
If needed I can send the document file to reproduce the issue.
I would appreciate any help.