| FoxitPDFSDKforWeb v11.1.0 Archives Foxit PDF SDK for Web

Public Member Functions | List of all members
OverlayComparisonService Class Reference
PDFViewCtrl » overlayComparison

Overlay comparison function entry, this instance must be obtained through PDFViewer.getOverlayComparisonService method. More...

## Public Member Functions
HTMLCanvasElement | compareImageData (OverlayComparisonOptions options)
| This method can be used to compare the pixels between two images by overlaying them and generating an output image (HTMLCanvasElement). where the image data can be retrieved from the PDF document via the PDFPage.render API. This method allows you to implement your own difference algorithm, which is achieved by customizing the BlendColorResolver. More...

## Detailed Description

Overlay comparison function entry, this instance must be obtained through PDFViewer.getOverlayComparisonService method.

See also
  PDFViewer.getOverlayComparisonService

Since
  9.0.0

## Member Function Documentation

## ◆ compareImageData()

HTMLCanvasElement OverlayComparisonService::compareImageData | ( | OverlayComparisonOptions | options | ) |

This method can be used to compare the pixels between two images by overlaying them and generating an output image (HTMLCanvasElement). where the image data can be retrieved from the PDF document via the PDFPage.render API. This method allows you to implement your own difference algorithm, which is achieved by customizing the BlendColorResolver.

Parameters

  options | OverlayComparisonOptions - The comparison options object, it must contain at least two attributes sourceBitmap and targetBitmap.

Returns
  HTMLCanvasElement - Returns the canvas element as the comparison result

Since
  9.0.0

@2026 Foxit Software Incorporated. All rights reserved.