DOC Preview using JS/Jquery RRS feed

  • Question

  • Hello All,

    Can I directly display a doc file for review before downloading it.When I use Iframe it is getting downloaded instead of display.(unlike text/image).

    Is there any javascript libraries available for converting 

    doc files to html

    or binary files to html(as i could convert doc to binary)

    Thanks in advance.

    Thursday, October 20, 2016 10:33 AM

All replies

  • Thursday, October 20, 2016 8:54 PM
  • Hi Slava,

    Thanks for the reply.

    DOCX.js had code for  converting xml to html and vice-versa.

    Even view.js dont have the desired.

    can you suggest with some other options.



    • Edited by dhruvii Friday, October 21, 2016 12:24 PM
    Friday, October 21, 2016 12:24 PM
  • Hello Dhruvii,

    Unfortunately I cannot suggest yet another lib for conversion of document formats, you would need to search the Internet. Anything you may find will be very complicated to parse properly DOC file. Other than try to convert file content to another format why would you just render original document with 3rd party document viewer in iframe? Lots of ppl take this way as far as I aware. At least two viewers for your convenience ... 

    1. Microsoft Office 365 viewer

    <iframe src='' width='1366px' height='623px' frameborder='0'>This is an embedded <a target='_blank' href=''>Microsoft Office</a> document, powered by <a target='_blank' href=''>Office Online</a>.</iframe>

    2. Google Documents' Viewer

    <iframe src=""></iframe>
    Over there you may find the discussion on rendering ... How to render word document(DOC,DOCX) in browser using Javascript

    Don't forget to render it inside your O365 add-in you need to use SSL (https) connection and 3rd party URLs must me in the list of trusted app domains of the add-in manifest.

    Hope this helps,

    Slava Ivanov

    Friday, October 21, 2016 12:57 PM