| FoxitPDFSDKforWeb v11.0.6 Archives Foxit PDF SDK for Web

Public Member Functions | List of all members
StampService Interface Reference
PDFViewCtrl » stamp

A singleton class, which can be obtained via PDFUI.getStampService. It can be used to obtain the currently selected stamp icon and monitor the switching action between stamp icons. More...

## Public Member Functions
StampInfo | getCurrentStampInfo ()
| Obtains the current stamp info object if the current state handler is STATE_HANDLER_CREATE_STAMP . More...
Function | onCustomStampUpdated (callback:(stamps:StampInfo[])=>void)
| Listen to the custom stamp list update event, which is triggered when the custom stamp is added, removed or updated. More...
Function | onSelectStampInfo (callback:(stampInfo:StampInfo|undefined)=>void)
| Listen to the stamp icon switching event, which is triggered when the stamp icon is switched using the StateHandlerManager.switchTo interface. The event will also be triggered when the state handler is switched from STATE_HANDLER_CREATE_STAMP to other state-handlers, At this time, the stampInfo obtained by the callback parameter will be undefined,. More...

## Detailed Description

A singleton class, which can be obtained via PDFUI.getStampService. It can be used to obtain the currently selected stamp icon and monitor the switching action between stamp icons.

See also
  PDFUI.getStampService

Since
  9.0.0

Examples:

Using in UIExtension

var pdfui = new UIExtension.PDFUI({ PDFUI constructor options... });
var stampService = pdfui.getStampService();

## Member Function Documentation

## ◆ getCurrentStampInfo()

StampInfo StampService::getCurrentStampInfo | ( |  | ) |

Obtains the current stamp info object if the current state handler is STATE_HANDLER_CREATE_STAMP .

Returns
  StampInfo|undefined - The currently selected stamp info object. If no stamp is selected, returns undefined.

Since
  9.0.0

## ◆ onCustomStampUpdated()

Function StampService::onCustomStampUpdated | ( | callback:(stamps:StampInfo[]) | ,
|  | void |
| ) |  |

Listen to the custom stamp list update event, which is triggered when the custom stamp is added, removed or updated.

Parameters

  callback | (stamps:StampInfo[])=>void - The event listener function.

Returns
  ()=>void - A function for removing event listener.

Since
  11.0.0

## ◆ onSelectStampInfo()

Function StampService::onSelectStampInfo | ( | callback:(stampInfo:StampInfo|undefined) | ,
|  | void |
| ) |  |

Listen to the stamp icon switching event, which is triggered when the stamp icon is switched using the StateHandlerManager.switchTo interface. The event will also be triggered when the state handler is switched from STATE_HANDLER_CREATE_STAMP to other state-handlers, At this time, the stampInfo obtained by the callback parameter will be undefined,.

Parameters

  callback | (stampInfo: StampInfo | undefined) => void - The event listener function.

Returns
  ()=>void - A function for removing event listener.

Since
  9.0.0

@2025 Foxit Software Incorporated. All rights reserved.