Compare
Send two source files to the viewer 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 viewer 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 viewer.
1. Host posts compare
Send the two source URLs and any optional compare settings.
2. Viewer emits comparisonComplete
On success, the viewer returns a completion payload that can include the output file URL.
3. Viewer 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 viewer.
Use align when the two source files need point matching before comparison.
- Align: Align
- Technical Reference: API References
- Overview: Compare Overview
