PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
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.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.
| Field | Purpose |
|---|---|
customStamps[] | Custom stamps (persisted to localStorage). |
stampPanelTabs[] | Tabs shown in the stamp panel. |
importStamps[] | Stamps available for import. |
StampPanel.vue (components/StampPanel/) — the stamp picker with Standard / Dynamic / Custom tabs (tabs set in App/index.vue via setStampPanelTabs). Lazy-loaded.CustomStamp.vue — custom stamp creation UI.DeleteCustomStampDialog — confirm custom stamp deletion.The core bridge exposes on instance.Core:
| Function | Purpose |
|---|---|
getDynamicStampPreview | Get a dynamic stamp preview. |
getStampRect | Get the stamp rectangle. |
handleStamp | Apply a stamp. |
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.
UI.addCustomStamps([{ src: '/stamps/draft.png', label: 'Draft' }]);
UI.openElement('stampPanel');UI.setStampPanelTabs(['standard', 'custom']);const stamps = UI.getCustomStamps();