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

Free Support Forum - aspose.com

Word document compare - page setup changes are not yielding expected results in the specified scenario

*** This is minor issue compared to other issues reported on the compare API

*When using Aspose compare API to compare the two Word documents with multiple page setup/layout changes in between them in different parts of the document or in different sections of the document, it is not yielding expected results in the specified scenario. It is not giving some page setup changes.

I took a Word document and applied 4 page setup/layout changes in different parts of the document… and ran Aspose compare API, which gave only 2 revisions. But I expect 4 revisions to come.

Refer to the attached documents.

Source.doc - source document.

Target.doc - Initially copied the Source.doc into Target.doc… then made four page setup/layout changes on top of it without modifying any content of the document.

I have done following four page setup/layout changes to Target.doc without
(Note: Page numbers given in below points are those within Target.doc when viewed the Target.doc at 100% zoom level in Print Layout view)

(1) Initially for the “whole document” - changed margins/height/width + changed orientation to Landscape — applied this change to whole document.
(2) Then moved down to a following section in the page# 5 - and changed margins/height/width + changed orientation back to Portrait — applied this change only to that section.
(3) Then moved down to a following section in the page# 9 - and changed margins/height/width + changed orientation back to Landscape — applied this change to “From this point Onwards” from that section onwards.
(4) Then moved down to a following section in the page# 16 - and changed margins/height/width + changed orientation back to Landscape — applied this change only to that section.

So totally done 4 page setup changes to the Target document.*

Aspose_Compare_Result.docx — then Aspose API generated this document with just 2 revisions.

  • MS_Word_Compare_Result.docx — but MS Word generated only 1 revision…

So Aspose comparison is better than MS Word comparison in this test case!

Aspose compare API is working fine for most page setup changes, but for multiple page setup changes within the same document, it is not giving desired results.

But still in this test case, i would expect 4 revisions to be reported by Aspose API…

Can you please look into this?


Need one clarification:
In the revisions generated for the above page setup changes, when the revision document (document after compare is done) is viewed in the MS Word… for the revision, the MS Word shows Left, Right, Top, Bottom, Height and Width values. It doesn’t indicate the orientation change.

Doesn’t the revision changes explicitly capture the orientation change e.g. orientation: Landscape?

Do we have to derive orientation from height and width values (based which value is greater)?

Hi Satya,

Thanks for your inquiry. I have used the following code for testing and attached output documents here for your reference:

Document doc1 = new Document(MyDir + @"Source.docx");
Document doc2 = new Document(MyDir + @"Target.docx");
doc1.Compare(doc2, "author", DateTime.Now);
OoxmlSaveOptions opts = new OoxmlSaveOptions(SaveFormat.Docx);
opts.Compliance = OoxmlCompliance.Iso29500_2008_Transitional;
doc1.Save(MyDir + @"15.8.0.docx", opts);

As you can see in attached documents, the results produced on my end are different than you have reported. e.g. “15.8.0.docx” has only one “Formatting” revision while MS Word 2013 produced three “Formatting” revisions in “msw-2013-compared.docx”.

But in this test case, since you’re expecting four revisions to be reported by Aspose.Words, we have logged this requirement in our issue tracking system as WORDSNET-12386. Our product team will further look into the details of this problem and we will keep you updated on the status of this issue. We apologize for any inconvenience.

Best regards,

Thanks for testing this.

Yeah, now when i am testing it, i am getting one difference only from Aspose Compare API both with and without save options you mentioned above. However my MS Word tool is version 2013, it is giving only one difference, but not three differences like you see.

But however like I mentioned above, i expect 4 revision changes because i have updated/overwritten page setup/layout changes at 4 places in different sections in the document.

Thanks for logging an issue for investigating this. I will wait for the update from you on this.

Hi Satya,

Thanks for additional information. If you please test 15.8.0.docx from my previous post, you will get 10 ‘Format Change’ revisions, each section has format revision in comparison result. You can easily check this by Document.Revisions.Count and following code:

Document doc = new Document(MyDir + @"15.8.0.docx");
foreach (Revision rev in doc.Revisions)

During investigation we found that MS Word has some issues related to section formatting revisions. For example if you select “No markup” view which should show final view, MS Word shows section formatting incorrectly. MS Word shows correct result if only you select “Accept all changes”.So it is not a surprise that MS Word shows only one revision in comparison result.

If we can help you with anything else, please feel free to ask.

Best regards,

Hi Satya,

Regarding WORDSNET-12386, our product team has completed the work on your issue and has come to a conclusion that they won’t be able to implement the fix to your issue. Your issue (WORDSNET-12386) has now been closed with ‘Won’t Fix’ resolution. Please see description in mu previous post.

Best regards,