Measurement Scales
Read and set the active measurement scale for the current Canvas document using the SDK.
Use viewer.measurements.scale to read and set the active measurement scale for the current Canvas document.
Scale commands are available after the viewer is mounted, Canvas is ready, and a document is open.
- Apply a scale only after the document is active. Canvas ignores scale updates when no file is loaded.
Retrieve the current active scale and all defined scales:
get(...)sendsgetScalesand waits for the next matchingscalesSnapshot. Canvas scale snapshots are not request-ID correlated, sofileIndexis the only SDK-side filter when Canvas includes it.
Subscribe to real-time scale changes emitted by Canvas:
Triggers getScales command on Canvas but resolves instantly as void. Use this when you are already listening to the snapshot stream.
Add a new scale definition and set it as selected:
add(...)sendsaddScaleand returnsvoid. Listen forsnapshotor callget(...)afterwards if you need visual UI verification.
Supported scale configuration properties:
- Always use the exact full unit names above. Abbreviations like
m,mm,ftare not valid unit types.
Restrict scale configuration to specific pages using 1-based inclusive range tuples:
Define complex imperial scale ratios with fractional dimensions:
Canvas emits scale configuration arrays inside the following wrapper:
Complete implementation code setup for Vanilla HTML/JS environments:
Complete React Component implementation details:
Ensure scale modifications are handled entirely client-side:
Angular component integration setup details:
Scale actions map cleanly to Canvas broker command flows:
viewer.measurements.scale.request(...)sendsgetScales.viewer.measurements.scale.get(...)sendsgetScalesand awaitsscalesSnapshot.viewer.measurements.scale.add(...)sendsaddScale.viewer.measurements.scale.on("snapshot", ...)listens forscalesSnapshot.
