The document's annotations, reloaded whenever the document changes and whenever an annotation is added/updated/removed — from these methods or from the user editing in the viewer (the annotationsChanged event).
annotationsChanged
The current annotations state and actions.
const { annotations, add } = useAnnotations();// draw a red rectangle on page 1await add(1, { subtype: 'square', rect: { left: 50, top: 700, right: 200, bottom: 640 }, color: { r: 220, g: 30, b: 30, a: 255 }, borderWidth: 2 }); Copy
const { annotations, add } = useAnnotations();// draw a red rectangle on page 1await add(1, { subtype: 'square', rect: { left: 50, top: 700, right: 200, bottom: 640 }, color: { r: 220, g: 30, b: 30, a: 255 }, borderWidth: 2 });
The document's annotations, reloaded whenever the document changes and whenever an annotation is added/updated/removed — from these methods or from the user editing in the viewer (the
annotationsChangedevent).