Interface: StampAnnotations
Groups all the API actions related to the stamp annotations.
Properties
addEventListener()
addEventListener: (
eventName,callback) =>void
Adds an event listener for the stamp annotations.
Parameters
• eventName: "rotationChanged" | "toggled" | "deleteCompleted" | "deleteFailed" | "lockChanged" | "predefinedTextStampTypeSelected"
The name of the event to listen for.
• callback: (active) => void | (stampType) => void | (annotation) => void | (annotation, error) => void | (annotation, locked) => void | (annotation, degrees) => void
The callback function to execute when the event is triggered.
Returns
void
emitDeleteCompleted()
emitDeleteCompleted: (
annotation) =>void
Triggers an event indicating that a stamp annotation has been successfully deleted.
Parameters
• annotation: StampAnnotation
The stamp annotation that was deleted.
Returns
void
emitDeleteFailed()
emitDeleteFailed: (
annotation,error) =>void
Triggers an event indicating that a stamp annotation deletion has failed.
Parameters
• annotation: StampAnnotation
The stamp annotation that failed to delete.
• error: Error
The error that occurred during deletion.
Returns
void
emitLockChanged()
emitLockChanged: (
annotation,locked) =>void
Triggers an event indicating that a stamp annotation’s lock state has been changed.
Parameters
• annotation: StampAnnotation
The stamp annotation whose lock state was changed.
• locked: boolean
true if the annotation was locked, false if unlocked.
Returns
void
emitPredefinedTextStampTypeSelected()
emitPredefinedTextStampTypeSelected: (
stampType) =>void
Triggers an event indicating that a stamp type has been selected.
Parameters
• stampType: PredefinedTextStampType
The PredefinedTextStampType value that was selected.
Returns
void
emitRotationChanged()
emitRotationChanged: (
annotation,degrees) =>void
Triggers an event indicating that a stamp annotation has been rotated.
Parameters
• annotation: StampAnnotation
The stamp annotation that was rotated.
• degrees: number
The rotation angle in degrees (0, 90, 180, 270).
Returns
void
emitToggled()
emitToggled: (
active) =>void
Triggers an event indicating that the stamp annotations panel has been toggled (opened or closed).
Parameters
• active: boolean
true if the stamp annotations panel has been opened, false otherwise.
Returns
void
Example
viewer.stampAnnotations.emitToggled(true);
removeEventListener()
removeEventListener: (
eventName,callback) =>void
Removes an event listener for the stamp annotations.
Parameters
• eventName: "rotationChanged" | "toggled" | "deleteCompleted" | "deleteFailed" | "lockChanged" | "predefinedTextStampTypeSelected"
The name of the event to stop listening for.
• callback: (active) => void | (stampType) => void | (annotation) => void | (annotation, error) => void | (annotation, locked) => void | (annotation, degrees) => void
The callback function to remove.
Returns
void