문제

I've been trying for a while to install pdf.js on my server so that I can display a PDF in a viewer like they have in their demo:

http://mozilla.github.io/pdf.js/web/viewer.html

The problem is, I can't get the pdf to appear whatever I do. I've tried even uploading the whole directory with all its files and sub-directories to my server with the default pdf in place, but even that doesn't show the pdf!

These are all the files in the directory on my server:

https://github.com/mozilla/pdf.js

Does anyone know the correct way to implement this or is there a step-by-step guide out there that shows how to do it that I've missed? I'm assuming I don't need all the files in that directory either right?

Thanks for any guidance, really need it!

도움이 되었습니까?

해결책

You have to build the project using node make generic according to the build instructions on https://github.com/mozilla/pdf.js

After having placed the built files on a web server you can add the file query string to the url, e.g. http://server/pdf.js/web/viewer.html?file=http://server/some.pdf.

다른 팁

A pre-built implementation of pdf.js can be found at:

https://github.com/mozilla/pdf.js/tree/gh-pages

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top