mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
48.25k stars 9.96k forks source link

Can't build/run examples? #8223

Closed danielocdh closed 7 years ago

danielocdh commented 7 years ago

I want to run the pages on examples/components, I already have everything on my web page folder. I have tried building with gulp generic web default dist bundle-components components The viewers have missing files on load:

pdf.js-1.6.210/build/dist/web/pdf_viewer.css pdf.js-1.6.210/build/dist/web/compatibility.js pdf.js-1.6.210/build/dist/build/pdf.js pdf.js-1.6.210/build/dist/web/pdf_viewer.js

yangdailin commented 7 years ago

go to https://mozilla.github.io/pdf.js/getting_started/#download

danielocdh commented 7 years ago

@yangdailin I can run web/viewer.html with no issues, but the code is too complex for me, I wanted to learn from something more simple which allows text selection and I read somewhere that examples inside examples/components/ have text selection and they don't look so complex.

I'm using gulp server now, I get same 404 errors on examples/components/: pageviewer.html:32 GET http://127.0.0.1:8888/build/dist/web/pdf_viewer.css pageviewer.html:35 GET http://127.0.0.1:8888/build/dist/web/compatibility.js pageviewer.html:37 GET http://127.0.0.1:8888/build/dist/build/pdf.js pageviewer.html:38 GET http://127.0.0.1:8888/build/dist/web/pdf_viewer.js pageviewer.js:18 Uncaught ReferenceError: PDFJS is not defined at pageviewer.js:18

Thanks

danielocdh commented 7 years ago

Nevermind, I needed to have git installed on my system for the script to work correctly, after I installed git I was able to run examples after building with gulp dist