| FoxitPDFSDKforWeb v11.0.5 Archives Foxit PDF SDK for Web

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

## Public Member Functions
CombinePixelsOptions | extractAllOptions ()
| Extract all options as plain objects described by the CombinePixelsOptions interface. More...
Function | onChange (type:CombinePixelsOptionsKey, callback:OnOptionChangeCallback)
| Monitoring option changes. More...
void | setBlendColorResolver (BlendColorResolver blendColorResolver)
| Customize the blend color resolver, and changes can be monitored through `OverlayComparisonOptionsService.onChange('blendColorResolver', callback)`. More...
void | setShowDiffColor (boolean showDiffColor)
| Set whether to display the difference color, and changes can be monitored through `OverlayComparisonOptionsService.onChange('showDiffColor', callback)`. More...
void | setSourceDiffColor (DiffColor sourceDiffColor)
| Set the diff-color of the source document displayed on the comparison result image, and changes can be monitored through `OverlayComparisonOptionsService.onChange('sourceDiffColor', callback)`. More...
void | setSourceOpacity (number sourceOpacity)
| Set the opacity of the source document displayed on the comparison result image, and changes can be monitored through `OverlayComparisonOptionsService.onChange('sourceDocumentOpacity', callback)`. More...
void | setTargetDiffColor (DiffColor targetDiffColor)
| Set the diff-color of the target document displayed on the comparison result image, and changes can be monitored through `OverlayComparisonOptionsService.onChange('targetDiffColor', callback)`. More...
void | setTargetOpacity (number targetOpacity)
| Set the opacity of the target document displayed on the comparison result image, and changes can be monitored through `OverlayComparisonOptionsService.onChange('targetDocumentOpacity', callback)`. More...

## Detailed Description

See also
  PDFViewer.getOverlayComparisonOptionsService

Since
  9.0.0

## Member Function Documentation

## ◆ extractAllOptions()

CombinePixelsOptions OverlayComparisonOptionsService::extractAllOptions | ( |  | ) |

Extract all options as plain objects described by the CombinePixelsOptions interface.

Returns
  CombinePixelsOptions - A object copy of CombinePixelsOptions

Since
  9.0.0

## ◆ onChange()

Function OverlayComparisonOptionsService::onChange | ( | type:CombinePixelsOptionsKey | ,
|  | callback:OnOptionChangeCallback |
| ) |  |

Monitoring option changes.

Parameters

  type | CombinePixelsOptionsKey - The event type, should be the key of CombinePixelsOptions.
  callback | OnOptionChangeCallback - A callback to handle the changes of CombinePixelsOptions.

Returns
  ()=>void - A function used to remove event listener.

Since
  9.0.0

## ◆ setBlendColorResolver()

void OverlayComparisonOptionsService::setBlendColorResolver | ( | BlendColorResolver | blendColorResolver | ) |

Customize the blend color resolver, and changes can be monitored through `OverlayComparisonOptionsService.onChange('blendColorResolver', callback)`.

Parameters

  blendColorResolver | BlendColorResolver - The blend color algorithm function, which will be override the built-in blend color algorithm implementation.

See also
  onChange

Since
  9.0.0

## ◆ setShowDiffColor()

void OverlayComparisonOptionsService::setShowDiffColor | ( | boolean | showDiffColor | ) |

Set whether to display the difference color, and changes can be monitored through `OverlayComparisonOptionsService.onChange('showDiffColor', callback)`.

Parameters

  showDiffColor | boolean - If true, the difference color will be calculated based on targetDiffColor and sourceDiffColor.

See also
  BlendColorResolver

Since
  9.0.0

## ◆ setSourceDiffColor()

void OverlayComparisonOptionsService::setSourceDiffColor | ( | DiffColor | sourceDiffColor | ) |

Set the diff-color of the source document displayed on the comparison result image, and changes can be monitored through `OverlayComparisonOptionsService.onChange('sourceDiffColor', callback)`.

Parameters

  sourceDiffColor | DiffColor - Enumeration item of DiffColor

Since
  9.0.0

## ◆ setSourceOpacity()

void OverlayComparisonOptionsService::setSourceOpacity | ( | number | sourceOpacity | ) |

Set the opacity of the source document displayed on the comparison result image, and changes can be monitored through `OverlayComparisonOptionsService.onChange('sourceDocumentOpacity', callback)`.

Parameters

  sourceOpacity | number - An integer values between 0 and 255 (inclusive).

Since
  9.0.0

## ◆ setTargetDiffColor()

void OverlayComparisonOptionsService::setTargetDiffColor | ( | DiffColor | targetDiffColor | ) |

Set the diff-color of the target document displayed on the comparison result image, and changes can be monitored through `OverlayComparisonOptionsService.onChange('targetDiffColor', callback)`.

Parameters

  targetDiffColor | DiffColor - Enumeration item of DiffColor.

Since
  9.0.0

## ◆ setTargetOpacity()

void OverlayComparisonOptionsService::setTargetOpacity | ( | number | targetOpacity | ) |

Set the opacity of the target document displayed on the comparison result image, and changes can be monitored through `OverlayComparisonOptionsService.onChange('targetDocumentOpacity', callback)`.

Parameters

  targetOpacity | number - An integer values between 0 and 255 (inclusive).

Since
  9.0.0

@2025 Foxit Software Incorporated. All rights reserved.