Product: Web viewer
Product Version: 10.12.0
Please give a brief summary of your issue:Want to implement the compare sync functionality of side-by-side default on opening the side-by-side. I also tried setMultiViewerSyncScrollingMode but not working.
(Think of this as an email subject)
const setupSideBySideCompare = async (instance, selectedFile) => {
if (isLayover) {
await loadDocumentWithCleanup(instance, fileUrl);
}
isSideBySide = true;
Apryse.disableUIElements(instance);
UI.enableFeatures([UI.Feature.MultiViewerMode]);
const [documentViewer1, documentViewer2] = instance.Core.getDocumentViewers();
documentViewer2.loadDocument(selectedFile);
instance.UI.setHeaderItems((header) => {
const defaultHeader = header.headers?.default;
const updatedHeader = defaultHeader.filter(
(item) => ![‘Compare’, ‘Save’, ‘Side-by-Side’].includes(item.title)
);
header.headers.default = updatedHeader;
});
instance.UI.setMultiViewerSyncScrollingMode(‘SYNC’);
const startCompare = async () => {
const doc1 = documentViewer1.getDocument();
const doc2 = documentViewer2.getDocument();
if (doc1 && doc2) {
const beforeColor = new Color(21, 205, 131, 0.4);
const afterColor = new Color(255, 73, 73, 0.4);
const options = { beforeColor, afterColor };
await documentViewer1.startSemanticDiff(documentViewer2, options);
}
};
documentViewer1.addEventListener('documentLoaded', startCompare);
documentViewer2.addEventListener('documentLoaded', startCompare);
};
Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)
Please provide a link to a minimal sample where the issue is reproducible: