Stamps
Stamps are image-based annotations dropped onto the page. The WebViewer supports standard, dynamic, and custom stamps, managed through the stamp panel and a set of UI APIs.
UI APIs
UI.setStampPanelTabs(tabs)
Configure the tabs shown in the stamp panel.
UI.setStampPanelTabs(['standard', 'dynamic', 'custom']); // STANDARD / DYNAMIC / CUSTOMCalls useViewer.setStampPanelTabs(tabs). Tab identifiers: Standard, Dynamic, Custom (defined in constants/dataElements.js).
UI.setImportStamps(images)
Set the list of stamps available for import.
UI.setImportStamps([{ src: '/stamps/approved.png', label: 'Approved' }]);Calls useViewer.setImportStamps(images).
UI.addCustomStamps(images)
Add custom stamp images.
UI.addCustomStamps([{ src: dataUrl, label: 'My Stamp' }]);Calls useViewer.addCustomStamps(images). Custom stamps are persisted to localStorage under the customStamps key.
UI.setCustomStamps(stamps)
Replace the set of custom stamps.
UI.setCustomStamps([ /* full stamp list */ ]);Calls useViewer.setCustomStamps(stamps).
UI.getCustomStamps()
Get the current custom stamps.
/**
* @method UI.getCustomStamps
*/
const stamps = UI.getCustomStamps();Returns the getCustomStamps getter from the viewer store.
Stamp state (viewer store)
| Field | Purpose |
|---|---|
customStamps[] | Custom stamps (persisted to localStorage). |
stampPanelTabs[] | Tabs shown in the stamp panel. |
importStamps[] | Stamps available for import. |
Stamp components
StampPanel.vue(components/StampPanel/) — the stamp picker with Standard / Dynamic / Custom tabs (tabs set inApp/index.vueviasetStampPanelTabs). Lazy-loaded.CustomStamp.vue— custom stamp creation UI.DeleteCustomStampDialog— confirm custom stamp deletion.
Core bridge (stamp surface)
The core bridge exposes on instance.Core:
| Function | Purpose |
|---|---|
getDynamicStampPreview | Get a dynamic stamp preview. |
getStampRect | Get the stamp rectangle. |
handleStamp | Apply a stamp. |
Stamp preview helper
helpers/renderStampPreview.js provides a renderStampPreview class that creates a floating .stamp-preview div following the mouse over the .document area, showing the stamp image before it is placed. Methods: updateStampPreview(...), handleMouseMove, hidePreview, applyStyles.
Examples
Add a custom stamp and open the stamp panel
UI.addCustomStamps([{ src: '/stamps/draft.png', label: 'Draft' }]);
UI.openElement('stampPanel');Restrict the stamp panel to standard + custom
UI.setStampPanelTabs(['standard', 'custom']);Read current custom stamps
const stamps = UI.getCustomStamps();Related
- Annotations — stamps are a annotation type.
- Signatures
- Core Bridge
- API Reference