| FoxitPDFSDKforWeb v11.0.6 Archives Foxit PDF SDK for Web

Public Member Functions | List of all members
CustomDynamicStampAddon Class Reference
UIExtension » addons

Allows customization and management of dynamic stamps within PDF documents. More...

Inheritance diagram for CustomDynamicStampAddon:

## Public Member Functions
| getDynamicStamp ()
| Retrieves the custom dynamic stamp information. More...
| removeDynamicStamp (arr)
| Removes custom dynamic stamps by specifying their category and names. More...
| setDynamicStamp (stampInfo)
| Sets custom dynamic stamps with specific configurations. More...
Public Member Functions inherited from UIXAddon
| afterMounted (root)
| Lifecycle method: this method is called after the UI component element mout into DOM tree. More...
| beforeMounted (root)
| Lifecycle method: this hook is called before the UI component element mount into DOM tree. More...
| destroy ()
| Lifecycle method: to override this method to implement the destroying logics. This method is called when a PDFUI instance is destroyed or the addon is dettached from PDFUI. More...
| fragments ()
| UI fragment configurations of this addon. More...
| getI18NResources ()
| Get I18n resources. More details about I18Next, please visit: https://www.i18next.com/. More...
static | getName ()
| Returns the name of an addon. More...
| init (pdfui)
| Called when initializing this addon instance. More...
| pdfViewerCreated (pdfviewer)
| Lifecycle method: this method is called when PDFViewer instance has been created and is before the afterMounted method . More...

## Additional Inherited Members
Protected Member Functions inherited from UIXAddon
| receiveAction (actionName, args=[])
| When the user calls PDFUI.callAddon, the receiveAction method on the corresponding Addon will be triggered. Addon exposes the API through this method and different action values. In the custom Addon subclass, you should implement this method to implement exposed APIs. More...
Static Protected Member Functions inherited from UIXAddon
static | initOnLoad ()
| Called after loading this addon, and only called once, The UI modules, components and controllers should be initialized and registered in this function.

## Detailed Description

Allows customization and management of dynamic stamps within PDF documents.

Since
  9.2.0

Example of obtaining and using the Custom Dynamic Stamp Addon instance:
  pdfui.getAddonInstance('CustomDynamicStamp').then(customDynamicStampAddon => {
  if (customDynamicStampAddon) {
  const customStamps = dynamicStampAddon.getDynamicStamp();
  } else {
  console.error("Custom Dynamic Stamp Addon instance not found.");
  }
  });

## Member Function Documentation

## ◆ getDynamicStamp()

CustomDynamicStampAddon::getDynamicStamp | ( |  | ) |
| inline

Retrieves the custom dynamic stamp information.

This method allows you to retrieve information about the custom dynamic stamps that have been added.

Returns
  Promise<object[]> - A Promise that resolves to an array of custom dynamic stamp information objects.

Since
  9.2.0

Example of getting custom dynamic stamp information:
  pdfui.getAddonInstance('CustomDynamicStamp').then(async dynamicStampAddon => {
  if (dynamicStampAddon) {
  const customStamps = await dynamicStampAddon.getDynamicStamp();
  } else {
  console.error("Custom Dynamic Stamp Addon instance not found.");
  }
  });

See also
  setDynamicStamp

## ◆ removeDynamicStamp()

CustomDynamicStampAddon::removeDynamicStamp | ( |  | arr | ) |
| inline

Removes custom dynamic stamps by specifying their category and names.

This method allows you to remove one or more custom dynamic stamps based on their category and names.

Parameters

  arr | object[] - An array of objects specifying the category and names of stamps to be removed. [{ category:'xxx', names:['xxx'], }]

Returns
  void -

Since
  9.2.0

Example of removing custom dynamic stamps:
  pdfui.getAddonInstance('CustomDynamicStamp').then(dynamicStampAddon => {
  if (dynamicStampAddon) {
  const stampsToRemove = [{
  category: 'xxx',
  names: ['xxx'],
  }];
  dynamicStampAddon.removeDynamicStamp(stampsToRemove);
  } else {
  console.error("Custom Dynamic Stamp Addon instance not found.");
  }
  });

See also
  setDynamicStamp

## ◆ setDynamicStamp()

CustomDynamicStampAddon::setDynamicStamp | ( |  | stampInfo | ) |
| inline

Sets custom dynamic stamps with specific configurations.

This method allows you to define and add custom dynamic stamps to PDF documents. Each stamp is defined by an array of stamp information objects, which includes details such as the stamp's category, name, appearance, and text content.

Parameters

  stampInfo | object[] - An array of custom dynamic stamp information objects.

Note
  The width and height properties indicate the dimensions of the stamp icon, and the rect property represents the container for the custom text. Ensure that the rect size is smaller than the stamp icon size to display the text correctly. Refer to STAMP_TEXT_TYPE for details of textType.

[{
category:'xxx',
name:'xxx',
fileData:'xxx', // the URL of the stamp template, which supports both HTTP and Blob. the template type can be 'bmp','jpg','jpeg','png', 'webp','tif', and 'tiff'.
width:290,//optional.The width of stamp, the default value is the width of img
height:150,//optional.The height of stamp, the default value is the height of img
field:{
textType:'xxx', // the type of the stamp text
value:'xxx', //the custom text.
font:{ //optional
name:'xxx', //font family.
color:0, // text color.
size:18, //text size. If set, the rect parameter will be recalculated based on top and left
},
rect:{ //{ PDFRect } Coordinate system of PDF coordinate system
left:0,
right:30,
top:30,
bottom:0,
}
},
}]

Since
  9.2.0

Example of setting custom dynamic stamps:
  pdfui.getAddonInstance('CustomDynamicStamp').then(dynamicStampAddon => {
  if (dynamicStampAddon) {
  let param = [{
  category:'xxx',
  name:'xxx',
  fileData:'xxx',
  field:{
  textType:'xxx',
  value:'xxx',
  font:{
  name:'xxx',
  color:0,
  },
  rect:{
  left:0,
  right:30,
  top:30,
  bottom:0,
  }
  },
  }];
  dynamicStampAddon.setDynamicStamp(param);
  } else {
  console.error("Custom Dynamic Stamp Addon instance not found.");
  }
  });

@2025 Foxit Software Incorporated. All rights reserved.