Aspose word for Java - acceptAllRevisions() method is not working as expected

Hi Aspose team,

We are trying to compare 2 word documents, it is not working for some word documents.
Below is the complete code we are using.

com.aspose.words.Document wordDoc1 = new com.aspose.words.Document(oldDocStream);
com.aspose.words.Document wordDoc2 = new com.aspose.words.Document(newDocStream);
wordDoc1.acceptAllRevisions();
wordDoc2.acceptAllRevisions();

if (!wordDoc1.hasRevisions() && !wordDoc2.hasRevisions())
{
    wordDoc1.compare(wordDoc2, "Aspose Word API", new Date());
}
else
{
    logger.info("Aspose Limitation: Unable to compare docs, it contains unaccepted revisions");
}

Below code block is executed successfully without any exception, So I assume accepting revision is success.

wordDoc1.acceptAllRevisions();
wordDoc2.acceptAllRevisions();

But, wordDoc1.hasRevisions() returns true which means accepting revision is failed. As a result below message is printed in console.

“Aspose Limitation: Unable to compare docs, it contains unaccepted revisions”);

Could you please help on this?

@SundarG,

Please ZIP and upload your input Word documents (you are getting this problem with) here for testing. We will investigate the issue on our end and provide you more information.

Hi Hafeez,

Please find the sample doc as attachment.

acceptAllRevisions() is success in this document , but hasRevisions() also returns true, even after acceptAllRevisions() code run.

sample.zip (15.2 KB)

@SundarG,

We used the following code for testing:

Document doc = new Document("D:\\temp\\sample\\sample.doc");

doc.acceptAllRevisions();
System.out.println(doc.hasRevisions());

doc.save("D:\\temp\\sample\\awjava-18.3.doc");

Please try the latest version of Aspose.Words for Java i.e. 18.3 as it accepted all revisions in sample.doc correctly (see awjava-18.3.zip (3.1 KB)).