NPM Package/docs/components/annotation/clear
Clear
Manage active drawing states by clearing or deactivating annotation tools.
Effective document control requires a clean workspace. Use clear commands to reset the active drawing tool context and return to standard selection/navigation mode.
The SDK provides a dedicated viewer.tools.clear() method to reset the active drawing state without technical friction.
- Reset Canvas Context: Revert immediately back to standard navigation/selection pointer.
- Fire and Forget: Reset active state programmatically without complex callback flows.
- Selective Deactivation: Alternatively, deactivate a single tool by disabling it while preserving other states.
Manage active tools programmatically using the tools namespace API:
Clear active annotation tool
Disable a specific active tool
Configure tool activation and clear states in your integration code:
Full Implementation
The SDK translates high-level method calls into underlying Canvas events:
- `viewer.tools.clear()`: Sends the grouped Canvas
toolControlcommand with{ command: "clear" }. It is fire-and-forget.
