FoxitPDFSDKforWeb v10.0.0
Foxit PDF SDK for Web
CustomOptionsUpdater Class Reference

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:
Disposable

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)
 
 destroy ()
 

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

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