| FoxitPDFSDKforWeb v11.0.6 Archives Foxit PDF SDK for Web

Public Member Functions | List of all members
CustomOptionsUpdater Class Reference
PDFViewCtrl » interfaces

Defines the parameters in the customs object of the PDFViewer constructor that can be dynamically updated. The update methods listed here can be called at any time to dynamically update the application state. Please note that instances of this type must be obtained using the PDFViewer.getCustomOptionsUpdater() method. More...

Inheritance diagram for CustomOptionsUpdater:

## Public Member Functions
| updateGetAnnotComponentConfig (getAnnotComponentConfigCallback:(annotComponent:AnnotComponent, props:Array< String >)=>AnnotComponentConfig)
| Updates the callback function `getAnnotComponentConfig` and triggers the update of the AnnotComponent Config. The changes take effect immediately after invoking this method. More...
Public Member Functions inherited from Disposable
| addDestroyHook (...hooks)
| Add a function to destroyHooks list, which will be called during destroy. More...
| destroy ()
| ownsTo (owner)
| Establishes an ownership relationship where this instance will be destroyed when the owner is destroyed. Additionally, the owner will be automatically removed from the destroyHooks list when this instance is destroyed. More...

## Detailed Description

Defines the parameters in the customs object of the PDFViewer constructor that can be dynamically updated. The update methods listed here can be called at any time to dynamically update the application state. Please note that instances of this type must be obtained using the PDFViewer.getCustomOptionsUpdater() method.

See also
  PDFViewer.constructor
  PDFViewer.getCustomOptionsUpdater

Since
  9.1.0

Example: Retrieves the CustomOptionsUpdater instance
  const updater = pdfViewer.getCustomOptionsUpdater();

## Member Function Documentation

## ◆ updateGetAnnotComponentConfig()

CustomOptionsUpdater::updateGetAnnotComponentConfig | ( |  | getAnnotComponentConfigCallback:(annotComponent:AnnotComponent, props:Array< String >),
|  |  | AnnotComponentConfig
| ) |  |
| inline

Updates the callback function `getAnnotComponentConfig` and triggers the update of the AnnotComponent Config. The changes take effect immediately after invoking this method.

Parameters

  getAnnotComponentConfigCallback | (annotComponent:AnnotComponent,props:Array<String>)=>AnnotComponentConfig - A callback function used to generate configuration items for the AnnotComponent.

See also
  PDFViewer.constructor - The `getAnnotComponentConfigCallback` parameter has the same format as the PDFViewer.constructor parameter `options.customs.getAnnotComponentConfig`. The details of the configuration items refer to the AnnotComponentConfig.

Example: Disable movement of square and area highlight annot.
  pdfViewer.getCustomOptionsUpdater()
  .updateGetAnnotComponentConfig(function(annotComponent, props){
  var annot = annotComponent.getModel();
  var annotType = annot.getType();
  if (annotType === 'square') {
  return { moveable: false };
  } else if (annotType === 'highlight' && annot.isArea()) {
  return { moveable: false };
  } else if (annotType === 'freetext') {
  return { moveable: false, resizable: false };
  } else if(annotType === 'strikeout') {
  return { adjustable: false } // Other textmarks (including: underline, text highlight, strikeout, squiggly, not including: caret) also support only one configuration: adjustable.
  } else if(annotType === 'line') {
  return { moveable: false, resizable: false } // line, arrow, polyline, polygon, cloud are also support these two configurations
  } else if(annotType === 'text' || annotType === 'fileattachment') {
  return { moveable: false } // text and file attachment annot only supports one configuration: moveable
  }
  return {}
  });

Since
  9.1.0

@2025 Foxit Software Incorporated. All rights reserved.