Cant install Pdf.JS on React Native
See original GitHub issueConfiguration:
- MacOS and Node 8.x
- React Native
Steps to reproduce the problem:
- Start a react native project
- Yarn add pdfjs-dist
- Try to import pdfjs-dist
You will get a error like this
Unable to resolve module
./zlib_bindings
./node_modules/zlib/lib/zlib_bindings doesn’t exist
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:10 (4 by maintainers)
Top Results From Across the Web
react-native-pdf - npm
A react native PDF view component, support ios and android platform. Latest version: 6.6.2, last published: 5 months ago.
Read more >how i install the previous version react-native-pdf
You can install any npm module by mentioning the version as well. Remove the package from package.json first, then
Read more >Can't Use React PDF Viewer : r/reactjs - Reddit
Hi I have a small modal window that displays the contents of a .pdf file, I am using React PDF Viewer for this....
Read more >Images - React Native
Images. Static Image Resources. React Native provides a unified way of managing images and other media assets in your Android and iOS apps....
Read more >pdf viewer | Voters - Expo
We won't be adding React Native PDF to the Expo Go app (that you download from the App Store or Google Play Store)...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Anything is possible – you just need to implement logic similar to what src/display/canvas.js or src/display/svg.js implements.
Was looking into this myself, so figured I might leave some notes for future readers. Initially I found https://github.com/iddan/react-native-canvas which could move a step forward in at least getting rendering to work. It uses a WebView under the hood. When looking into WebView support, I did find this issue: https://github.com/mozilla/pdf.js/issues/7157#issuecomment-394066217 , and the comment which points to https://github.com/xcarpentier/rn-pdf-reader-js , which was actually built for Expo. It similarly uses a WebView under the hood (and uses
react-pdf
instead ofpdf.js
directly)