I am using the Adobe Embed API to display PDFs on my website. I have it working, but I am not able to find any way to reuse the viewer when I want to load a new PDF in the same session.
I was able to get it working if I just blew away the viewer instance. This feels like overkill, and like it would impact performance.
When I try to use the previewFile
command the second time, it results in a mobx
error:
await reportViewer.previewFile({
content: { location: { url: docURL } },
metaData: { fileName: 'dir.pdf' },
}, {
autoSaveFrequency: 0,
enableFocusPolling: false,
showSaveButton: true,
showAnnotationTools: false,
exitPDFViewerType: 'RETURN',
});
Error: [mobx] Invariant failed: Since strict-mode is enabled,
changing observed observable values outside actions is not allowed.
Please wrap the code in anaction
if this change is intended.
Tried to modify: [email protected]
Does anyone have any insight into the appropriate solution for this issue?