I’m designing a web application where a large portion of the site will be displaying user-generated documents. Now, I’ve already implemented LaTeX source code and pdf rendering on the website, but I am still can’t render Microsoft Word files (.doc and .docx) on the site. I’ve looked around and found a similar question (here), but it was never answered. I’m wondering whether or not using a web-based solution like Google Docs or doing it programatically on the server with OpenOffice are viable solutions. A pure JavaScript solution would be ideal though.
Share
Based on Vikram’s answer, you could use Google Docs Viewer in order to render the files. This way it should work on all browsers.
Instead of
use
But you have to urlencode the URL. For example,
becomes
You can go to https://docs.google.com/viewer in order to generate the links easily.
Moreover, Vikram’s code is old and ugly. You should use something like: