Rasterex APINPM Package/docs/components/collaboration/tools

Tools Interaction

How annotations and measurements work in a multi-user environment using the SDK.

Feature Synchronization

When collaboration is active, all primary tools in the canvas become collaborative by default. This includes annotations, measurements, and document state changes.

  • Annotations: Markups, shapes, and arrows drawn by one user appear instantly on all other users' screens.
  • Measurements: Dimension lines, area calculations, and counts are synchronized across all participants.
  • Navigation: Depending on configuration, page navigation and zoom levels can also be synchronized.

User Attribution

Each annotation and measurement is uniquely attributed to the user who created it.

When a user starts drawing, their identity (established via setUser(...)) is used to label the interaction. Other participants will see visual labels indicating which user is currently active.

  • Participant Labels: Hovering over or selecting an annotation displays the creator's display name.
  • Live Indicators: Visual cues (e.g., cursor colors) help identify multi-user presence on the canvas.
  • Persistent Ownership: Even after the session ends, the metadata for each markup contains the original author information.

Persistence & Autosave

Real-time synchronization ensures all users see the same state, while persistence ensures that state is saved to your database.

  • Auto-Save Integration: When Canvas auto-save is enabled, subscribe to creation events using the SDK annotations event interface.
  • Metadata Tracking: Each event payload contains authorship identifiers for correct database attribution.
  • Manual Extraction: Use viewer.annotations.save() to retrieve the current markup states programmatically.
typescript
// Listening for persistent collaborative actions:
viewer.annotations.on("created", (event) => {
  console.log("Markup created by participant:", event.guid);
  // Persist to your database API using event.data
});
Persistence & Autosave

Concurrent Interactions

The synchronization bridge handles multiple users opening the same file across different systems. All live actions are broadcasted in sub-second latency.

  • Simultaneous Drawing: Multiple users can draw markups or take measurements at the same time without locking the document.
  • Global Navigation: If configured, panning and zooming are synchronized, allowing a presenter to lead a group walkthrough.
  • Conflict Handling: The Canvas resolves overlapping actions logically to maintain a consistent state for all participants.