1

I'm trying to display a word document on my page and this is what I tried after searching online : <iframe src="file.docx" width="600px" height="400px" > </iframe>

But the Iframe appears empty and the file is downloaded instead of being displayed. Also I get the warning like : Resource interpreted as Document but transferred with MIME type application/vnd.openxmlformats-officedocument.wordprocessingml.document

Any help?

Aneesh
  • 1,651
  • 2
  • 20
  • 33
  • possible duplicate of [How to embed a document in HTML page?](http://stackoverflow.com/questions/5565759/how-to-embed-a-document-in-html-page) – Aniket Nov 19 '13 at 05:11

2 Answers2

3

You can use Google doc viewer for displaying pdf, doc, docx inside an iframe

<iframe src="https://docs.google.com/viewer?url={url}&embedded=true"> </iframe>

I haven't used this but Microsoft online doc viewer can also be used as explained here

http://view.officeapps.live.com/op/view.aspx?src=http://img.labnol.org/di/Word.docx

Vbp
  • 1,584
  • 1
  • 20
  • 28
1
<html>
<head>
    <title>Application Executer</title>
<style>
#frm
{
width:100%;
height:100%;
}
</style>
</head>
<body>
<object id="frm" data="Circuit.pdf">You do not have Word installed on your machine</object>
</body>
</html>

data="your file address" dont't forget css for full size,for docx use this: https://docs.google.com/viewer/ or convert it to pdf

reza jafari
  • 456
  • 6
  • 12