Free Support Forum -

Merged and UnMerged Document comparison issue in .NET


Compare UnMerged document and Merged document but getting result as incorrect.

After Comparison the result file is getting content separate pages not in single page but the content exist in Source and Target in same page

Find the attached documents (21.3 KB)

Comapred with below code

public string CompareSections(byte[] Source, byte[] Target)

    GroupDocs.Comparison.Common.ComparisonSettings.ComparisonSettings objComparisonSettings = new GroupDocs.Comparison.Common.ComparisonSettings.ComparisonSettings();

            objComparisonSettings.DeletedItemsStyle.StrikeThrough = true;
            objComparisonSettings.DeletedItemsStyle.FontColor = System.Drawing.Color.Red;

            objComparisonSettings.InsertedItemsStyle.FontColor = System.Drawing.Color.Green;

            objComparisonSettings.ShowDeletedContent = true;
            objComparisonSettings.StyleChangeDetection = true;
            objComparisonSettings.GenerateSummaryPage = false;

   System.IO.Stream SourceStrm = new System.IO.MemoryStream(Source);
   System.IO.Stream TargetStrm = new System.IO.MemoryStream(Target);

   GroupDocs.Comparison.Common.ICompareResult result = comparison.Compare(SourceStrm, TargetStrm, objComparisonSettings);


Merged docuement with below code

sourceDocument.FirstSection.PageSetup.SectionStart = SectionStart.Continuous;
foreach (Paragraph para in SourceDocument.GetChildNodes(NodeType.Paragraph, true))
     para.ParagraphFormat.KeepWithNext = true;
 TargetDocument.AppendDocument(SourceDocument, ImportFormatMode.KeepSourceFormatting);


We’ve logged this issue in our internal issue tracking system with ID : COMPARISONNET-1927. This is now under investigation, you shall be notified as we have any further update.


We’re pleased to notify you that your reported issue COMPARISONNET-1927 is now resolved in version 19.6. We’d recommend you to integrate latest release in your project and share your experience.