Disable image comparison in PDF documents

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Comparison MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-comparison -- dnx GroupDocs.Comparison.Mcp --yes
Folders, licensing and more →

On this page


GroupDocs.Comparison allows you to disable image comparison in PDF documents.

By default, the CompareImagesPdf option is true. Follow these steps to turn off image comparison:

  1. Instantiate the Comparer object. Specify the source file path or stream.
  2. Call the Add method. Specify the target file path or stream.
  3. Instantiate the CompareOptions object. Set the CompareImagesPdf property to false;
  4. Set the ImagesInheritanceMode property to ImagesInheritance.Source or ImagesInheritance.Target;
  5. Call the Comparer method. Specify the CompareOptions object from the previous step.

The following code snippet shows how to disable image comparison in PDF documents:

using GroupDocs.Comparison;
using GroupDocs.Comparison.Options;
// ...

using (Comparer comparer = new Comparer("source.pdf"))
{
    comparer.Add("target.pdf");
    CompareOptions compareOptions = new CompareOptions()
    {
        CompareImagesPdf = false,
        ImagesInheritanceMode = ImagesInheritance.Target
    }
    comparer.Compare("result.pdf", compareOptions);
}

The result is as follows:

On this page