Skip to content
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

Can I use this module in react native? #11217

Closed
zRelux opened this issue Oct 7, 2019 · 2 comments
Closed

Can I use this module in react native? #11217

zRelux opened this issue Oct 7, 2019 · 2 comments

Comments

@zRelux
Copy link

zRelux commented Oct 7, 2019

I tried to use this module with react native but I get this weird error about GlobalWorkerOptions
you can see it here Expo snack
is there anyway I can use this module in react native?
Thank you for any answer

@zRelux zRelux changed the title Can I use this in react native? Can I use this module in react native? Oct 7, 2019
@timvandermeij
Copy link
Contributor

timvandermeij commented Oct 7, 2019

You should be able to use PDF.js with React Native, but we don't explicitly provide support for third-party library integrations. However, the error you're facing seems to be because you're missing:

//
// The workerSrc property shall be specified.
//
pdfjsLib.GlobalWorkerOptions.workerSrc =
'../../node_modules/pdfjs-dist/build/pdf.worker.js';

See also #8305.

@luistak
Copy link
Contributor

luistak commented Oct 9, 2019

I added this simple example with create-react-app

#11220

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants