Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Mioleris opened this issue Sep 27, 2024 · 0 comments

Comments

@Mioleris
Copy link

Mioleris commented Sep 27, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant