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”
- Tried by updating to free latest version of apose to 20.9 from 17.12, to get several ignore formatting options like
- 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);