WebViewer Version: 11.2.0
Do you have an issue with a specific file(s)? Yes
Can you reproduce using one of our samples or online demos? No
Are you using the WebViewer server?
Does the issue only happen on certain browsers? No
Is your issue related to a front-end framework? No
Is your issue related to annotations? No
Please give a brief summary of your issue:
Getting error DocumentViewer2 are not initialized.
Please describe your issue and provide steps to reproduce it:
Trying to implement Side-By-Side Compare functionality. It was working fine in version 10, after updating to version 11.2.0 getting error DocumentViewer2 are not initialized.
Here is the code I am working on:
const setupSideBySideCompare = (instance, selectedFile) => {
disableUIElements(instance)
UI.enableFeatures([UI.Feature.MultiViewerMode]);
const [documentViewer1, documentViewer2] = instance.Core.getDocumentViewers();
documentViewer2.loadDocument(selectedFile);
const startCompare = async () => {
const shouldCompare = documentViewer1.getDocument() && documentViewer2.getDocument();
if (shouldCompare) {
const beforeColor = new Color(21, 205, 131, 0.4);
const afterColor = new Color(255, 73, 73, 0.4);
const options = { beforeColor, afterColor };
const { diffCount } = await documentViewer1.startSemanticDiff(documentViewer2, options);
}
};
documentViewer1.addEventListener('documentLoaded', startCompare);
documentViewer2.addEventListener('documentLoaded', startCompare);
};
Please provide a link to a minimal sample where the issue is reproducible: