Count Point Mode
Create Count groups, insert markers, and read or update marker metadata with the npm SDK.
Legacy is the default appearance. Canvas shows its native Count symbols and selection rings, which scale as you zoom.
Wait for Canvas to open the document before using Count. Check for countWorkflow to configure and finish a group, or countItemInfo to read and update markers.
Configure the group and activate Count before placing markers in Canvas.
After the operator places the markers, finish the group and refresh the annotation list. Use count.onFinished(handler) to observe Finish from inside Canvas. Call the returned unsubscribe function when the view is disposed.
Use the GUID of a Count record in the current document. Switch to native selection mode and select an editable group owned by the current user. Imported groups retain their original ownership, so a visible group can be readable while unavailable for editing.
count.insertPoint() arms one click on the native selection. For repeated insertion, await count.setPointMode({ enabled: true, guid: countGuid }). Show the mode as active only after Canvas acknowledges arming it. Both insertion commands use existing Canvas support without a dedicated SDK capability flag.
countGuid is the GUID of the existing Count group. Read its markers before and after the user clicks in the viewer. Confirm that the count increased and the prior IDs remain. To exit repeated mode, await count.setPointMode({ enabled: false }) and clear the native tool before starting another workflow. Stop on target or document changes and clean up on disposal.
count.getItems(countGuid) returns IDs, zero-based indices, points in nativeAnnotation coordinates, and per-marker info. Set itemId to the ID of the marker the operator chose.
setItemInfo() replaces the entire flat metadata object. Merge existing values when updating one field. Use strings, finite numbers, booleans, or null. Check the returned marker ID and metadata before updating the host UI.
After an error, refresh the list and confirm the group is still selected and editable before rearming insertion. After a timeout, an edit may already have happened. Read the markers before retrying.
Existing integrations can keep using viewer.annotations.setCountPointMode({ enabled: true, guid: countGuid }). This method returns void and exposes no acknowledgement to the caller.
Count point mode is available after the viewer is mounted, Canvas is ready, a document is open, and your app knows the target count annotation GUID.
Enable or disable insertion mode programmatically by passing the annotation GUID:
setCountPointMode()is fire-and-forget at the SDK boundary. Use the result-backed Count API when the host needs acknowledgement.
Use selection events to store the currently active count GUID:
Typical implementation for toolbar toggle button handlers:
Always disable count point mode when targeting transitions or state clear:
- The selected annotation changes.
- The active document or file tab changes.
- The component unmounts.
- The user deactivates the toggle.
Complete integration code setup for Vanilla HTML/JS environments:
Complete React Component implementation details:
Broker message mapping for setCountPointMode API:
viewer.annotations.setCountPointMode(...)maps toinsertCountPointMode.
