WebViewer Version:
Do you have an issue with a specific file(s)?
Can you reproduce using one of our samples or online demos?
Are you using the WebViewer server?
Does the issue only happen on certain browsers?
Is your issue related to a front-end framework?
Is your issue related to annotations?
Please give a brief summary of your issue:
(Think of this as an email subject)
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:
I’m doing a semantic comparison based on your example:
The initialization function (fullAPI: true,
licenseKey, path, ref.current are passed) is run separately in the hook, and the effect for starting the comparison mode is located nearby.
useEffect(() => {
if (!instance || !compareMode) {
return
}
const { firstFileBlob, secondFileBlob } = comparisonFiles
if (!firstFileBlob || !secondFileBlob) {
return
}
const runSemanticCompare = async () => {
const { Core, UI } = instance
const { Annotations } = Core
const { Color } = Annotations
const { enableFeatures, openElements } = UI
enableFeatures([UI.Feature.ComparePages, UI.Feature.MultiViewerMode])
openElements(['comparePanel'])
UI.enterMultiViewerMode()
const url1 = URL.createObjectURL(firstFileBlob)
const url2 = URL.createObjectURL(secondFileBlob)
const viewers = Core.getDocumentViewers()
if (viewers.length < 2) {
return
}
const [viewer1, viewer2] = viewers
await Promise.all([
viewer1.loadDocument(url1, { extension: 'pdf' }),
viewer2.loadDocument(url2, { extension: 'pdf' }),
])
const beforeColor = new Color(21, 205, 131, 0.4)
const afterColor = new Color(255, 73, 73, 0.4)
const options = { afterColor, beforeColor }
await viewer1.startSemanticDiff(viewer2, options)
}
runSemanticCompare().catch(err => console.error('err', err))
}, [instance, compareMode, comparisonFiles])
Running the comparison function returns the error “err TypeError: ua.beforeColor.toObject is not a function”
What could this be related to? The types seem to match.
Initialization and transition to multi-window are successful, only semantic comparison via coloring does not work
thanks
