Bookmark gets deleted automatically on downloading the document

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"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",
//Some code
//Download the document. 
outputStream = response.getOutputStream();
byte[] bytes = new byte[4 * 1024];
int read;
if (inputStream.markSupported())
while ((read = != -1)
	outputStream.write(bytes, 0, read);

If needed I can send the document file to reproduce the issue.
I would appreciate any help.


Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please attach the output Word file that shows the undesired behavior.
  • Please create a simple Java application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we’ll start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

Sorry for late reply, Please find the attached zip project(created using eclipse ide) including the original document and converted document.
Thanks in advance.


Unfortunately, we have not found the attachment with your post. Please attach it again. Thanks for your cooperation.

It was due to our company policy.sorry for that.
Please find attached sample project along with the original and output document.

Last content control bookmark gets deleted when I call


You have not attached the requested resources. Please check the attached image for upload button. upload.png (7.0 KB)

1 Like

I don’t know why the file is not getting uploaded.
Howevere let me try once again.
Please find attached.


Unfortunately, we have not found the attachment in this thread. Please try some other browser or create new topic in Aspose.Words forum.

You can also upload the ZIP file to Dropbox and share the download link here for testing. Thanks for your cooperation.

Here it is the link to the file.


Thanks for sharing the detail. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-17177. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-17177) have been fixed in this Aspose.Words for .NET 18.9 update and this Aspose.Words for Java 18.9 update.