Reputation: 9722
What I would like to do is supply some embed code for a PDF hosted on my website. The purpose is to allow anyone to take this code and slap it on their website ... pretty much exactly like YouTube videos or any other embedable content.
I've seen all forms of code, ranging from EMBED
, OBJECT
, IFRAME
...
Is is just a case of changing this sample YouTube code to point to my file:
<iframe width="420" height="315" src="http://www.youtube.com/embed/oRdxUFDoQe0" frameborder="0" allowfullscreen></iframe>
<iframe width="420" height="315" src="http://www.domain.com/embed/myfile.pdf" frameborder="0" allowfullscreen></iframe>
What method is the best and most accurate?
Upvotes: 1
Views: 169
Reputation: 2510
My favorite is google docs, extremely reliable and flexible:
<iframe src="http://docs.google.com/gview?url=http://infolab.stanford.edu/pub/papers/google.pdf&embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe>
replace the url=... with your pdf url
Live example: http://googlesystem.blogspot.com/2009/09/embeddable-google-document-viewer.html
Upvotes: 1