API References
Technical reference for compare, align, and revision result events.
Call viewer.compare.compare({ backgroundUrl, overlayUrl }) when both source files are already positioned correctly and you want Canvas to generate a visual diff. Verified against SDK 2.2.3, it returns Promise<ComparisonResult> and resolves after the payload-bearing comparisonComplete and following progressEnd events.
The promise rejects on invalid input, unavailable readiness, a conflicting pending comparison operation, Canvas comparison errors, command timeout, or disconnect. Handle rejection to restore host controls and show a recoverable error. Example URLs below must be replaced with Canvas-reachable source URLs.
Call viewer.compare.align({ backgroundUrl, overlayUrl, alignArray }) when the source files require interactive point matching, or when the host already has alignArray point objects.
Both compare and align report through the same completion and error event listeners on viewer.compare. Compare additionally returns a promise; align remains event-driven.
- comparisonComplete: Fires when the compare or align workflow finishes successfully (or reaches the interactive align stage).
- comparisonError: Fires when the compare or align workflow fails.
