Free Support Forum -

Compare in Aspose Words for Java

How does the Aspose compare work with Aspose.words for Java?
Will we be able to see the compare as shown in the URL:

But this is stating as only for .Net and no mention is provided for .java. Can you please explain.


Thanks for your inquiry. Please refer to the following article about comparing document using Aspose.Words for Java.
How to Compare Two Word Documents

Thanks for your quick reply. We tried this but we are not able to see any output generated let alone see the differences as shown in the link.
We are not sure what we missed. We can still work on this but I want to understand if the output look and feel of the comparison will be same like how its shown in the link for Aspose compare for .Net.

Kindly confirm.


Thanks for your inquiry. Aspose.Words for Java is just a class library and with it you can programmatically generate, modify, convert, render and print documents without utilizing Microsoft Word®. So, it does not offer any UI or web control for performing these document processing tasks on web pages.

Please use the following code example to compare documents. Open the output document in MS Word to see the difference. This code example also saves the document pages into images. You can use these images into your application to view them.

Document docA = new Document(MyDir + "DocumentA.docx");
Document docB = new Document(MyDir + "DocumentB.docx");, "user", new Date()); // docA now contains changes as revisions + "output.docx");

// Save the document to images
int count = docA.getPageCount();
for (int i = 0; i < count; i++)
    ImageSaveOptions opt = new ImageSaveOptions(SaveFormat.PNG);
    opt.setPageCount(1); + "out_" + i + ".png", opt);