We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Convert DOCX to HTML & Insert HTML String in Word Document then Compare Images in DOCX Files using Java

Hi I found problem with compare images in documents.
code to show problem :

HtmlSaveOptions htmlSaveOptions = new HtmlSaveOptions(SaveFormat.HTML);
htmlSaveOptions.setPrettyFormat(true);
htmlSaveOptions.setExportListLabels(ExportListLabels.AS_INLINE_TEXT);
htmlSaveOptions.setImageSavingCallback(imageSavingArgs -> {});
htmlSaveOptions.setExportHeadersFootersMode(ExportHeadersFootersMode.NONE);
htmlSaveOptions.setExportImagesAsBase64(true);
htmlSaveOptions.setExportTextInputFormFieldAsText(true);
Document doc = new Document("…\test.docx");
String st = doc.toString(htmlSaveOptions);
DocumentBuilder builder = new DocumentBuilder();
builder.insertHtml(st);
Document docFromHtml = builder.getDocument();
docFromHtml.save("…\test_fromHtml.docx");
docFromHtml.save("…\test_fromHtml2.docx");
Document docWithChanges = new Document("…\test_fromHtml2.docx");
docFromHtml.compare(docWithChanges, “me”, new Date());
docFromHtml.save("…\test_out.docx");
docFromHtml.save("…\test_out.html");

As y can see there are revisions but nothing changed. In attach test documents.
imageCompareTest.zip (132.0 KB)

@vhostt,

We are able to reproduce the issue as you mentioned by using your sample files and code snippet. To address this problem, we have logged a ticket with an ID “WORDSNET-20823” in our bug tracking system. We will look into it further soon and let you know once we have an update on it. Sorry for the inconvenience.

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

thx, looks good