ApryseSDK / webviewer-ui

WebViewer UI built in React
Other
409 stars 353 forks source link

[Bug] documentLoaded event fires once after downloadPdf but not second time. #1077

Open Mioleris opened 1 month ago

Mioleris commented 1 month ago

I have simple implementation.

      WebViewer(
        {
          path: '/webviewer',
          initialDoc: null,
          preloadWorker: 'pdf,office',
          fullAPI: true,
          licenseKey: LICENCE_KEY
        },
        document.getElementById(this.webViewerId)
      ).then((instance: WebViewerInstance) => {
        instance.Core.PDFNet.runWithCleanup(
            () => this.callback(instance),
            process.env.LICENCE_KEY
        )
      })

Here I prepare webviewer instance. Inside callback I have events like documentLoaded

In my application I have button download. Which calls loadDocument(fileUrl) and it triggers pdfTron event documentLoaded.

So when I click download one time everything works it triggers documentLoaded and inside I have await instance.UI.downloadPdf() and document downloads.

If I try to download another document nothing happens. Event documentLoaded is not triggered at all.

Second time I just noticed that documentUnloaded event was fired.

Version 10.12.0

bollain commented 1 week ago

Hey @Mioleris,

Apologies for the delayed response. This appears to be an issue with the Core side of Webviewer, not the UI.

Can you submit a support ticket through this portal? https://support.apryse.com/support/tickets/new