The project versions compare differs between the PDF and Word documents

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());
    }
  }

@dfinsolutions This is the expected behavior, just like in MS Word. By default, when you open the resulting docx file, it opens with the “Simple Markup” option in the reviewing panel. But when saving to PDF, the “All markup” option will be used. Unfortunately, it is not possible to change this option programmatically, because MS Word does not store these parameters.

@vyacheslav.deryushev But even after manually selecting ‘All Markup’ in the Word file, it shows no changes. The Word comparison result still has one page less than the PDF comparison result.

@dfinsolutions It’s not quite clear what you mean. MS Word generates 3 pages after comparison and save them as 3 pages. Aspose.Words just mimic this behavior. You can change the display only inside MS Word. When you select “All Markup” in the resulting file, you can see that the document consists of 3 pages. Please check my resulting file (received via MS Word) and screenshots from my screen. Do you have different page count?

modified.zip (147.2 KB)