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

Free Support Forum - aspose.app

Document compare docx files with merge fields


Using com.aspose:aspose-words:17.12:jdk16
When Document.compare with .docx files having merge fields, the format with merge field gets messed up. Difference is displayed at the end of the paragraph, instead where the location is.

// Create com.aspose.words.Document with “InputStream”
com.aspose.words.Document asposeOrig = new com.aspose.words.Document(is);
com.aspose.words.Document asposeCurrent = new com.aspose.words.Document(is2);

final CompareOptions compareOptions = new CompareOptions();
asposeOrig.compare(asposeCurrent, “System”, new Date(), compareOptions);

final PdfSaveOptions opts = new PdfSaveOptions();

//Save compare document to “OutputStream”
asposeOrig.save(out, opts);

  1. Tried by updating to free latest version of apose to 20.9 from 17.12, to get several ignore formatting options like
  2. Tried to save these documents locally in various types of document, seems that the issue is in “compare” API, it is messing up the format of the merge fields.
    All the mentioned files are displaying the exactly same result.
  • asposeOrig.save(“C:\apose\testing.doc”, opts1);
  • asposeOrig.save(“C:\apose\testing.pdf”, opts);
  • asposeOrig.save(“C:\apose\testing.html”, opts3);

This topic has been moved to the related forum.