Client-Side Compare
Compare two documents in the viewer with the NPM SDK, adjust their appearance, and align matching points.
Use viewer.clientCompare for an in-viewer comparison. It keeps the background and overlay documents open in Canvas and does not create a server-side comparison file.
This API is separate from viewer.compare, which creates a comparison file.
Mount the viewer and wait for readiness before creating the comparison. Provide one source for each document; each source may be a URL or a Canvas-resolved file name.
Change the blend and common geometry after the comparison is ready.
- Opacity: accepts a value from 0 to 100.
0fades the background,50balances the blend, and100fades the overlay. - Common level: accepts a value from 1 to 10.
1is near white and10is black.
Subscribe before starting alignment. alignStarted acknowledges the request; the completion event arrives after the user selects a point in each document.
- Keep alignment pending until
alignCompleteorfailedis received. - Only one alignment session should run at a time.
Call close() to stop alignment and clear its active state. The source documents remain open.
The available events are ready, opacityChanged, commonLevelChanged, alignStarted, alignComplete, closed, and failed.
The SDK correlates responses by request ID, applies the configured command timeout, rejects overlapping create or alignment commands, and rejects pending commands when the viewer is destroyed.
