Comparing images generate output in PDF file format instead of image

Comparing images generate output in PDF file format instead of image

document1.jpg (37.0 KB)

document1.jpg (37.0 KB)

 using (Comparer comparer = new Comparer("document1.jpg"))
            {
                comparer.Add("document2.jpg");
                comparer.Compare("result.jpg");
            }

@tahir.manzoor
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): COMPARISONNET-3738

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@tahir.manzoor

That’s not an issue, this is a peculiarity of the program. The GenerateSummaryPage option is responsible for this. It is enabled by default to display the resulting page with the number of changes. If the GenerateSummaryPage option is set to false, the program will save the result as a picture.

To do this, use following code

using GroupDocs.Comparison.Options;

public static void Main(string[] args)
{
    // Set the GroupDocs Comparison license
    GroupDocs.Comparison.License lic = new License();
    lic.SetLicense(@"D:/GD Licenses/Conholdate.Total.Product.Family - 2023-07-06.lic");

    // Define the paths to source and target files
    string source = @"D:/document1 (1).jpg";
    string target = @"D:/document1.jpg";

    // Create a temporary output file
    var temOutputFileName = Path.GetTempFileName();

    // Initialize the Comparer with the source document
    Comparer comparer = new Comparer(source);

    // Add the target document for comparison
    comparer.Add(target);

    // Compare the documents and specify comparison options
    comparer.Compare(@"D:/mustbeimage.jpg", new CompareOptions() { GenerateSummaryPage = false });
}