Text only comparison in .docx and .pdf files

Hi Guys,

Is it possible to configure GroupDocs.Comparison to compare text of document only (potentially compare styles of document too).

I am using CompareDocs in similar way:

            string source = @"C:\temp\sample.docx";
            string target = @"C:\temp\sample_copy.docx";

            using (Comparer comparer = new(source))
            {
                comparer.Add(target);
                comparer.Compare(
                    @"C:\temp\Report.docx",
                    new CompareOptions
                    {
                        DetalisationLevel = DetalisationLevel.High,
                        DetectStyleChanges = true,
                    });

                ChangeInfo[] changes = comparer.GetChanges();
                // check changes object
            }

Could you please assist me in understanding if it is possible and how should I configure CompareOptions maybe? If I would like images to be ignored and only text of document compared (for .docx and .pdf).

@usernamename

Please take a look at the following documentation articles:

  1. Customize changes styles
  2. Get source and target text from files
  3. Get list of changes

Please take a look at the first point (shared earlier). You can compare files and set/customize style changes.
If you still need any assistance, we’d recommend you to share the source, target files and expected output.

1 Like