Replies: 1 comment
-
HI @mikelehen I tried integrating pdf.js with a React Native App, got it working on Android but not on iOS. I leveraged legacy version of pdf.js (2.x.x) as it exports commonJS modules. Did you progress further on this issue? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is the feature relevant to the Firefox PDF Viewer?
No
Feature description
[I'm Guessing this isn't a supported platform, but I'm logging an issue for posterity and for other people to find, etc.]
I can't seem to get pdf.js to work from an iOS React Native app. I tried both the modern build and the legacy build. With either one I get an error while bundling like:
I think React Native has to resolve all dynamic imports at compile time, so you can't import from a variable. So I tried manually modifying
node_modules/pdfjs-dist/legacy/build/pdf.mjs
and hardcoding it toimport('./pdf.worker.mjs')
, but it still doesn't work. For some reason the bundler hangs at 99.7%:I am not sure why or how to debug further. 🤷 Any tips / suggestions welcome.
Other PDF viewers
No response
Beta Was this translation helpful? Give feedback.
All reactions