WebViewer Version: 8.0.0
[WebViewer Server] server version: 1.5.6-gf198a7c
Do you have an issue with a specific file(s)?
No
Can you reproduce using one of our samples or online demos?
No
Are you using the WebViewer server?
Yes
Does the issue only happen on certain browsers?
No
Is your issue related to a front-end framework?
Maybe, I’m using react
Is your issue related to annotations?
Yes
Please give a brief summary of your issue:
Webviewer server annotations
Please describe your issue and provide steps to reproduce it:
Annotations are not received and not displayed while files are loaded by webviewer server, but if I will replace loading doc by webviewer server and just put doc url into initialDoc
property - all works fine, and also if I remove webviewerServerURL
property all works fine to.
Please provide a link to a minimal sample where the issue is reproducible:
const instance = await WebViewer(
{
path: '/WebViewer/lib',
fullAPI: true,
licenseKey: license,
enableAnnotations: true,
preloadWorker: 'pdf',
webviewerServerURL: pdfTronServerUrl,
singleServerMode: true
},
viewer.current as HTMLElement
);
instance.UI.loadDocument(docUrl, {
filename: fileName,
customHeaders: {
...headers
}
});
Annotations were stored by this way:
const handleGetFile = useCallback(async () => {
const { documentViewer, annotationManager, SaveOptions } = instance.Core;
const receivedDoc = documentViewer.getDocument();
const xfdfString = await annotationManager.exportAnnotations();
const options = {
xfdfString,
flags: SaveOptions.LINEARIZED,
downloadType: 'pdf'
};
const data = await receivedDoc.getFileData(options);
const arr = new Uint8Array(data);
const blob = new Blob([arr], { type: 'application/pdf' });
const { closeElements } = instance.UI;
closeElements(['menuOverlay']);
}, [instance]);