Matthew
Matthew

Reputation: 55

PDF.Js doesn't load PDF file

I have downloaded PDF.Js from Github. I changed the

var DEFAULT_URL = 'http://www.krishnamraju.com/downloads/web/krishnam.pdf'; in viewer.js in Web Directory.

But when I open http://krishnamraju.com/downloads/web/viewer.html I can see the PDF container with tools but the PDF does not load in to it.

Can you please help?

Upvotes: 1

Views: 3944

Answers (1)

Riddhesh Sanghvi
Riddhesh Sanghvi

Reputation: 1222

Try giving a relative path. Use this:

var DEFAULT_URL = 'krishnam.pdf'; as both the pdf and viewer.js sit in the same folder.

Or even a better solution is to use '?file' param as a dynamic path to pdf's look here for more information.

Upvotes: 1

Related Questions