FoxitPDFSDKforWeb v12.0.0
Foxit PDF SDK for Web
CompareFilterOptionsService Class Reference

Service for reading and writing comparison-result filter options. More...

Public Member Functions

CompareFilterOptions getDefaultFilterOptions ()
 Returns a copy of the default filter options applied when a comparison result document is opened. More...
 
CompareFilterOptions getFilterOptions ()
 Returns a copy of the current filter options (the Filter dropdown state). Opening a comparison result resets this to getDefaultFilterOptions(). More...
 
Function onFilterOptionsUpdated (callback)
 Subscribe to filter-option changes from the API or the Filter dropdown. If options already have a value, the callback is invoked immediately with the current options when subscribing. More...
 
void setDefaultFilterOptions (options)
 Store default filter options used when a comparison result document is opened. This does not update the currently displayed Filter dropdown; call updateFilterOptions for that. More...
 
void updateFilterOptions (options)
 Update the currently displayed filter options (checkboxes and layer visibility). This does not change getDefaultFilterOptions(). The next opened comparison result still applies the stored defaults. More...
 

Detailed Description

Service for reading and writing comparison-result filter options.

Use this to change which change categories (text, images/graphics, annotations, formatting) are checked in the Filter dropdown. setDefaultFilterOptions only stores defaults for the next comparison result document; it does not change the currently displayed Filter dropdown. Use updateFilterOptions to change the current checkboxes and layers.

Since
12.0.0
See also
ComparisonAddon.getCompareFilterOptionsService
CompareFilterOptions
const addon = await pdfui.getAddonInstance('Comparison');
const service = addon.getCompareFilterOptionsService();
service.setDefaultFilterOptions({
Text: true,
Images: true,
Annotation: false,
Formatting: false
});

Member Function Documentation

◆ getDefaultFilterOptions()

CompareFilterOptions CompareFilterOptionsService::getDefaultFilterOptions ( )

Returns a copy of the default filter options applied when a comparison result document is opened.

Returns
CompareFilterOptions
Since
12.0.0

◆ getFilterOptions()

CompareFilterOptions CompareFilterOptionsService::getFilterOptions ( )

Returns a copy of the current filter options (the Filter dropdown state). Opening a comparison result resets this to getDefaultFilterOptions().

Returns
CompareFilterOptions
Since
12.0.0

◆ onFilterOptionsUpdated()

Function CompareFilterOptionsService::onFilterOptionsUpdated ( callback  )

Subscribe to filter-option changes from the API or the Filter dropdown. If options already have a value, the callback is invoked immediately with the current options when subscribing.

Parameters
callback(newOptions: CompareFilterOptions) => void
Returns
Function - Unsubscribe.
Since
12.0.0

◆ setDefaultFilterOptions()

void CompareFilterOptionsService::setDefaultFilterOptions ( options  )

Store default filter options used when a comparison result document is opened. This does not update the currently displayed Filter dropdown; call updateFilterOptions for that.

Parameters
optionsPartial<CompareFilterOptions> - If Everything is a boolean, the four category flags (Text, Images, Annotation, Formatting) are all set to that boolean and other keys in options are ignored. Otherwise the stored defaults are replaced and omitted keys become false. When a comparison result is opened, Everything on the Filter dropdown is derived from whether all four categories are true.
Returns
void
Since
12.0.0
service.setDefaultFilterOptions({
Text: true,
Images: true,
Annotation: false,
Formatting: false
});
service.setDefaultFilterOptions({ Everything: true });

◆ updateFilterOptions()

void CompareFilterOptionsService::updateFilterOptions ( options  )

Update the currently displayed filter options (checkboxes and layer visibility). This does not change getDefaultFilterOptions(). The next opened comparison result still applies the stored defaults.

Parameters
optionsPartial<CompareFilterOptions> - Flags to merge into the current Filter dropdown. Omitted keys keep their current values. If Everything changes, all four categories are set to that boolean (same as the Filter dropdown). If Everything is omitted, it is derived from whether all four categories are true. If no comparison result document is open, this still updates helper current state, but the next opened result will reset to getDefaultFilterOptions().
Returns
void
Since
12.0.0
service.updateFilterOptions({ Annotation: true });

Foxit Software Corporation Logo
@2026 Foxit Software Incorporated. All rights reserved.