Did I understand correctly what you’re trying to do? If the code above is not what you’re trying to achieve, could you please share with us the part of your code related to this issue so we could help you better?
The WebViewer is loaded in the background but is never actually visible. We call the below code block to download the pdf with annotations applied and without having to interact with the WebViewer. The works perfectly on Chrome (multiple times), but on Firebox on both Mac and Windows, it hangs where noted the second time it’s called. For example when we download 1 file, then try to download another.
const { UI, Core } = this.instance
const { documentViewer, annotationManager } = Core
await documentViewer.closeDocument() // closeDocument() is where firefox hangs on the second call
const { app, blob } = await this.downloadFileFromServer(app) // api call
UI.loadDocument(blob, { filename: `${app.name}.${app.extension}` })
documentViewer.addEventListener('documentLoaded', async () => {
// if closeDocument() is removed, the documentLoaded event never fires
const { data } = await this.getAnnotations(app) // api call
if (data != null && data.annotations != null) {
for (const anno of data.annotations) {
const [annotation] = await annotationManager.importAnnotationCommand(anno)
if (annotation !== undefined) {
await annotationManager.redrawAnnotation(annotation)
}
}
}
await this.instance.downloadPdf({ includeAnnotations: true, flatten: false })
})
My sincere apologies for the delay here. Unfortunately, I’m still not able to reproduce the issue as I cannot have the exactly same code you have. Is there any console error when you run your application on Firefox?
Can you please share with us what you have on the getAnnotations method?
If you have a staging application that we can use to investigate this better it would be great. If you want to share your code privately you can send me through my email: dnavarro@apryse.com.