How do you embed a remotely located PDF in a HTML page?
I need to display a PDF on a website and have it embedded inline.
The following code works if the data attr开发者_如何学Pythonibute is local, but not remote. I just get a large grey box in place of the PDF. I'm open to any solution as long as it works in all browsers. We are using Rails 3 and jQuery.
<object data='https://remotesite.com/uploads/pdf/5/mypdf.pdf' type='application/pdf' width='100%' height='100%'>
<p>
It appears your Web browser is not configured to display PDF files.
No worries, just <a href='https://remotesite.com/uploads/pdf/5/mypdf.pdf'>click here to download the PDF file.</a>
</p>
</object>
Thanks, Nick
I tried this. works fine. just the link you supported is not OK. (I cannot reach\download that pdf other way) But you can try this also:
<iframe src="http://people.seas.harvard.edu/~chong/pubs/oopsla04.pdf" width="100%" height="300">
<p>Your browser does not support iframes.</p>
</iframe>
your code worked fine with this pdf I used for the iframe.
(i tested both on chrome and internet explorer)
精彩评论