Firefox issues with PDFtron WebViewer intialization

132 views
Skip to first unread message

Xavier Hocquet

unread,
Apr 5, 2021, 2:55:17 PM4/5/21
to PDFTron WebViewer
Hi there,

We are using the WebViewer successfully in Chrome to do some text searching on PDF documents, however the same code fails on Firefox. This is the setup code (using Webpacker for assets) -

CoreControls.setWorkerPath('/packs/webviewer/core')
    PDFNet.initialize()
      .then(() => PDFNet.addResourceSearchPath('/packs/webviewer'))
      .then(() => {
        setSearchTerms(terms)
        setSearchCount(0)
      })

In Firefox, we get the following error in console -

Unknown action from worker: pdfNetAddResourceSearchPath PDFworker.js:1:13232
Error: Unknown action from worker: pdfNetAddResourceSearchPath

As far as I'm aware, the WebViewer is supported across major browsers. Anything we might be doing wrong?

Thanks,
Xavier Hocquet

Sardor Isakov

unread,
Apr 7, 2021, 5:06:43 PM4/7/21
to PDFTron WebViewer
You are using WebViewer in full mode and without WebViewer UI? Have you loaded PDFNet.js file?

Sardor Isakov
Software Developer
PDFTron Systems, Inc.

Xavier Hocquet

unread,
Apr 7, 2021, 7:43:31 PM4/7/21
to PDFTron WebViewer
I'm not the main developer on this side of things so apologies if anything sounds confusing coming from me.

It looks like we are loading both in order to use CoreControls to use some of the searching functionality. We are using the WebViewer UI to display documents. We have the following included in the page -

<script src="/packs/webviewer/core/CoreControls.js"></script>
<script src="/packs/webviewer/core/pdf/PDFNet.js"></script>

And just to reiterate, the same method calls work successfully in Chrome.

Thanks
Xavier

WebViewer Support

unread,
Apr 8, 2021, 7:33:19 PM4/8/21
to pdfnet-w...@googlegroups.com, pdfnet-w...@googlegroups.com
Hello PDFTron,

Are there any network errors (404 error) in the developer tool?


 Best Regards,
Sardor Isakov
Software Developer
PDFTron Systems, Inc.
CONFIDENTIALITY NOTICE: This message (and any attachment to it) is intended only for the use of the individual or entity to which it is addressed in the header, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. Any reproduction, distribution, modification or use of the contents of this message (and any attachment to it) by any individual or entity other than the intended recipient is prohibited. If you have received this communication in error, please notify us immediately and delete the original. 
, PDFTron WebViewer Forum <pdfnet-w...@googlegroups.com> wrote:
--
You received this message because you are subscribed to the Google Groups "PDFTron WebViewer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdfnet-webview...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pdfnet-webviewer/06f3e00c-6676-4d2f-ba7d-30a2076ecf47n%40googlegroups.com.
21253:789536
Reply all
Reply to author
Forward
0 new messages