question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cant install Pdf.JS on React Native

See original GitHub issue

Configuration:

  • 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
yurydelendikcommented, Aug 22, 2017

is it possible to use webGL to achieve this ?

Anything is possible – you just need to implement logic similar to what src/display/canvas.js or src/display/svg.js implements.

0reactions
agilgur5commented, Jul 29, 2018

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 of pdf.js directly)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found