Reputation: 7626
I want to display content of word file in browser same like we display pdf file in browser. I don't want any plugin because if I use plugin I have to install for all browser. I want just one solution which works in all browser.
I have searched on google, but I found all link which directly download word file and open it.
Currently I am using object tag for displaying pdf file but it is not working for word file. It is showing message: The plug-in is not supported.
Upvotes: 2
Views: 1257
Reputation: 1234
Great question. In principle, browsers only really tend to support viewing websites (e.g. html
). Most, however, also support viewing PDFs, and, as you've correctly identified, you could use plugins to extend the behaviour. Crucially, though, some browsers provide document viewing with a javascript
-based viewer.
I wasn't aware of it before you asked, but there are apparently javascript
implementations of non-PDF document readers--for example, ViewerJS--that seem to directly support .odt
. With a little digging, you might be able to find an implementation/plugin for a javascript
viewer that supports .docx
. However, I can't recommend one from personal experience at the moment. I would recommend searching for javascript document viewers
though.
Upvotes: 0
Reputation: 13621
Using a browser plug-in (such as the free Word Viewer) is by far the easiest method, and arguably the most correct - however, there are some alternatives if you really don't want to do this:
Upvotes: 1