Hello. We are experiencing some issues while trying to compare two documents and get the comparison result in PDF and Word formats. We are using the aspose.words library. The PDF comparison result has one extra page compared to the Word result. The provided files have a page break and text between them. We also have other examples where the comparison results in PDF and Word differ in page count. The files are attached. Below is the code snippet to replicate this behavior.
In case some options need to be passed to avoid such outcome, please advise.
original
original.docx (11.4 KB)
modified
modified.docx (11.4 KB)
@Test
public void testingDocumentCompare() {
try {
Document original = new Document(new ClassPathResource("/aspose/original.docx").getInputStream());
Document modified = new Document(new ClassPathResource("/aspose/modified.docx").getInputStream());
original.compare(modified, "Testing", new Date());
original.save("result.docx");
original.save("result.pdf");
} catch (Exception e) {
Assertions.fail(e.getMessage());
}
}