-1

i want to open pdf files that are linked to in a document in a new page in the pdf.js viewer.

i have downloaded the zip file from github:

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

and gone to both of the index.html files in the examples folder.

i get blank pages when opening either of these files.

can anyone please tell me how to implement pdf.js so that i can open pdf documents in a new page in the pdf viewer?

thank you.

1
  • Which browser do you use? The viewer does not work correctly in IE Commented Feb 20, 2013 at 8:18

2 Answers 2

1

Try using '?file=url' in query-string with viewer.html.
For example: www.example.com/pdf-js/web/viewer.html?File="URL"

Source: pdf-js on github

And yes, you will most definitely have cross-domain issues if not using any web-server, as mentioned by @Silent.

Cheers.

Sign up to request clarification or add additional context in comments.

Comments

0

Let me guess that you tried to directly open the examples via chrome. Your url probably starts off with file:///. This is causing a cross origin request error to occur on your browser. To properly view the examples, you need a LAMP stack.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.