It is possible to display a pdf inside a div using this:
<div>
<object data="test.pdf" type="application/pdf" width="300" height="200">
PDF : <a href="test.pdf">test.pdf</a>
</object>
</div>
Is it possible to do something similar for a .doc or .docx? (without server side)
- I am assuming the browser or the computer has a way of reading the data.
Might I suggest Google Doc Viewer, it'll allow you up show several types of files inline where they would normally prompted for download:
https://docs.google.com/viewer/
You can also use this inline in your own website with the use of an iframe.
Here is a list of supported file-types:
I messed around with this for mobile output of PDFs but the mobile version had an error that made it impossible to use. Not sure where the development on this product has landed but the desktop version always worked very well.