-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cant install Pdf.JS on React Native #8774
Comments
|
Please provide complete example. |
Actually, I'll close it won't fix. Even if we will solve zlib_binding, there is no guarantee rest of PDF.js will work -- PDF.js need "native" browser's DOM to work. |
React Native code does not run on a full node.js environment, so zlib is not available by default. If I just add pdfjs-dist to package.json it goes to a zlib com not be found error. And got that error, |
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. |
Haha thanks you but those files are 2000 lines of code and my webGL knowledge is nihil :) Also pdfjs doesn't work well with expo yet (zlib). Neither webview |
Latter next month I may have to dig in a way to use pdf.js with expo (and react-native).
I think using a abstracted dom or a web view is not the way, maybe gl, svg or canvas, still have to take some time to understand better what pdf.js is capable.
About zlib and other node libraries, I’ve found out you can go around that by implementing some aliases on babel and installing some npm packages. But there is a lot of going around to do and a lot of bugs to catch.
… On Aug 23, 2017, at 6:27 AM, De Lille Felix ***@***.***> wrote:
Haha thanks you but those files are 2000 lines of code and my webGL knowledge is nihil :)
Also pdfjs doesn't work well with expo yet (zlib). Neither webview
expo/expo-sdk#82 <https://github.com/expo/expo-sdk/issues/82>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#8774 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AFGkfpPegKgAZd6vkGessquMTtq8VFPwks5sa_CHgaJpZM4O1uKR>.
|
yes, Expo doesn't have way to show PDF right now and neither has PDF.js. |
Was looking into this myself, so figured I might leave some notes for future readers. |
Configuration:
Steps to reproduce the problem:
You will get a error like this
The text was updated successfully, but these errors were encountered: