Hi,
I would like to use the standalone PDF viewer in my React app, but if I use it at a URL other than the root, it seems to be looking for its .js files (webworker) in the wrong place:
Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'http://localhost:3000/buildings/details/iZLTXCxRnzPrd2ZcwDmO/ej2-pdfviewer-lib/pdfium.js' failed to load.
at handleError (http://localhost:3000/static/js/bundle.js:462802:58)
at http://localhost:3000/static/js/bundle.js:462821:7
How can I fix this?
Thanks,
Tony
The reported issue “PDFium path issue when the PDF Viewer is not on the index page” was resolved in version v23.1.40. Kindly upgrade to that version to get the issue resolved.
Also, we have added a new API for adding the PDFium path and we have provided guidelines to follow and a sample has been provided for reference.
|
Load libraries from resourceUrl
Create React Pdfviewer sample:
Resolve library path issue:
|
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/react-route1966464177.zip
Steps to run the sample: