Compare
Send two source files to the canvas and receive a completion or error event for comparison.
The compare workflow posts a `compare` message with a background file URL and an overlay file URL. The canvas processes both inputs and emits either a completion event or an error event.
Optional compare settings let the host tune rendering DPI and output colors for the generated diff.
A compare request needs the two file URLs. DPI and output styling are optional.
Send compare
Listen for completion
Listen for errors
The compare lifecycle is request-driven. The host submits URLs, then waits for either success or failure from the canvas.
1. Host posts compare
Send the two source URLs and any optional compare settings.
2. Canvas emits comparisonComplete
On success, the canvas returns a completion payload that can include the output file URL.
3. Canvas emits comparisonError
On failure, surface the reason to the user and keep the compare form editable.
This host-side pattern sends compare requests and handles both completion and failure events from the canvas.
Use align when the two source files need point matching before comparison.
- Align: Align
- Technical Reference: API References
- Overview: Compare Overview
