Preview documents in a browser

Is there a way to preview documents in a browser? In particular, say an iframe inside a page, as opposed to opening a document in a new tab? I have a list of files of any type, and when the user clicks on it, you want to open it in readonly format. If this file is a video or audio file, it is quite simple, but I would also like to be able to make PDF files, Word documents, possibly superior. Preferably, this would be in a friendly browser, but if I need to find a plugin (I saw the Google Docs Viewer for FF), I can live with it.

UPDATE:

ShaneC's answer is great and will work well overall. The only thing I see is that for html5 devices (think ipad) I need to convert the document to a series of images. Is there any way for me to do this in an automatic way? I need to be able to do this automatically when uploading a new document.

+6
source share
2 answers

You want to integrate a cross-browser interstitial document viewer. Google will provide you with good sites, I personally had a good impression of Flex Paper .

For demos see here: http://flexpaper.devaldi.com/demo/

+4
source

There is Javascript ViewerJs. An open source tool that allows a website to display PDF and open the standard for office documents. It will display documents inside and without browser plugins.

+1
source

Source: https://habr.com/ru/post/896529/


All Articles