Service for reading and writing comparison-options dialog parameters (Include checkboxes, marking color, opacity, line thickness).
More...
|
| async | getDefaultOptions () |
| | Returns a copy of the persisted comparison-options defaults the dialog loads on open. Color values are always 0xRRGGBB numbers. Waits for options storage initialization. More...
|
| |
| async | getOptions () |
| | Returns a copy of the current comparison-options dialog parameters. Color values are always 0xRRGGBB numbers. Waits for options storage initialization. More...
|
| |
| | onOptionsUpdated (callback:(options:CompareDocumentParams)=> void) |
| | Subscribe to comparison-options changes from the API or the options dialog. If options already have a value, the callback is invoked immediately with the current options when subscribing. More...
|
| |
| async | setCompareTable (compareTable:boolean) |
| | Set whether the next comparison includes table differences. More...
|
| |
| async | setCompareTextOnly (compareTextOnly:boolean) |
| | Set whether the next comparison includes text-only differences. More...
|
| |
| async | setDefaultOptions (options:CompareDocumentParamsPatch) |
| | Merge a partial snapshot into the persisted defaults the options dialog loads on open. Omitted keys keep their current default values. This does not change the current options used by the next compare(); call setOptions for that. More...
|
| |
| async | setDetectPageDeletionsOrInserts (detectPageDeletionsOrInserts:boolean) |
| | Set whether the next comparison detects page deletions or inserts. More...
|
| |
| async | setLineThickness (lineThickness:Partial< Option< number >>) |
| | Set marking line thickness per change type (1–12). Omitted keys keep their current values. Values are rounded and clamped to 1–12. More...
|
| |
| async | setMarkingColor (markingColor:Partial< Option< number|string >>) |
| | Set marking colors used to highlight replace, insert, and delete changes. Omitted keys keep their current values. Invalid color values are ignored. More...
|
| |
| async | setOpacity (opacity:Partial< Option< number >>) |
| | Set marking opacity per change type (0–100). Omitted keys keep their current values. Values are rounded and clamped to 0–100. More...
|
| |
| async | setOptions (options:CompareDocumentParamsPatch) |
| | Merge a partial snapshot into the current options used by the next compare(). Omitted keys keep their current values. This does not change getDefaultOptions(); call setDefaultOptions to persist dialog defaults. More...
|
| |
Service for reading and writing comparison-options dialog parameters (Include checkboxes, marking color, opacity, line thickness).
Per-field setters wait for options storage initialization, then update both the current options used by the next compare() and the persisted defaults the dialog loads on open. setOptions updates only the current options. setDefaultOptions updates only the persisted defaults.
- Since
- 12.0.0
- See also
- ComparisonAddon.getCompareDocumentParamsService
-
Option
-
CompareDocumentParams
-
CompareDocumentParamsPatch
const addon = await pdfui.getAddonInstance('Comparison');
const service = addon.getCompareDocumentParamsService();
await service.setCompareTextOnly(true);
await service.setMarkingColor({
replace: 0xFFCC00,
insert: '#149BFF',
delete: 0xFA0005
});
const options = await service.getOptions();