Document Viewer like (PdfDocxTxt.etc) in jquery or javascript

Last Reply 12 days ago By dharmendr

Posted 14 days ago

Document Viewer using Javacript or Jquery like (Pdf,DOCX,Txt,Img..etx)

You are viewing reply posted by: dharmendr 12 days ago.
Posted 12 days ago

You need to use JavaScript library.

For PDF

https://github.com/webodf/ViewerJS

For Doc

https://github.com/stephen-hardy/DOCX.js

https://stackoverflow.com/questions/27957766/how-do-i-render-a-word-document-doc-docx-in-the-browser-using-javascript

For text file make ajax call and read the content and display in div.

JavaScript

$(function(){
    $.ajax({
        url : "Default.aspx/GetText",
        dataType: "text",
        success : function (response) {
            $("#text").html(response);
        }
    });
});

 HTML

<div id="text"></div>