webodf / ViewerJS

ViewerJS: Document Reader in JavaScript
http://viewerjs.org
1.94k stars 421 forks source link

PDF renderer in an other page #167

Open BirbaManuel opened 8 years ago

BirbaManuel commented 8 years ago

Hello guys,

I tried to use your demo but the pdf open in an other page... Where should I put the link because If I follow well yours instructions (step 5) you mentioned that to put this link on the document. In fact when I click on button ViewerJS this link works put the pdf open in an other page...

Weird things happen if I use iframe src = "/ViewerJS/#../demo/ohm2013.odp" width='400' height='300' allowfullscreen webkitallowfullscreen></iframe please se attachement on below

chrome:35.0.1916.153 m issueviewerjs

FireFirefox : 40.0.3 ff_pdf_viewer

Internet Explorer: 7.0.6002.18005 ieliseusepdf

What I did wrong?

chrilith commented 8 years ago

Do you have the full code of your page or link? I see on your screenshots that your browsers are pointing to /ViewerJS/ with no document.

BirbaManuel commented 8 years ago

Hello chrilith, thanks for your attention. In fact I follow the step of http://viewerjs.org/ and tried the instruction to embed the document. The problem is the iframe markup does'nt work with Firefox and Chrome browse when you will uncomment it and comment : a href="/ViewerJS/pdf/demodoc.pdf" you will anderstand what I mean

```
chrilith commented 8 years ago

Hi,

Your src is wrong. It should be "/ViewerJS/#/pdf/demodoc.pdf" (it supposes that you put the ViewerJS folder and content at the root of your website).

This will load the index.hml file (check that your web server is configured to use index.html as a default page) located in the /ViewerJS folder and then, the script inside will check in the parent iframe src if there is any file to locally download and will load it if it is a found/recognized file.

Also, Why is there all this code after your iframe? Looks like you put an iframe ut also the index.html viewer code.