Reputation: 2670
Is there any way i can load PDF file (its contents) in a div or iFrame?
I have a bunch of PDF files on a server and, ideally, i need to have a button 'Show file' on a page, clicking on which will load the contents of selected file in a div(iFrame).
Upvotes: 1
Views: 16465
Reputation: 644
Google's gview is sometimes unresponsive and given 204 status. Here is the best free alternative. https://stackoverflow.com/a/66548544/2078462
Upvotes: 0
Reputation: 2921
You can also use google pdf view by using iframe
on your page :
<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>
Instead of this in above code :
http://infolab.stanford.edu/pub/papers/google.pdf
Use your own PDF
file path.
You can view the demo
here.
http://googlesystem.blogspot.in/2009/09/embeddable-google-document-viewer.html
It's just a suggestion. No downvotes please.
Upvotes: 7