Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Document Previews in Browser

Is there some way to preview documents in browser? Specifically in say an iframe within a page, as opposed to opening the doc in a new tab? I have a list of files of any type and when a user clicks on one, want to open it in a readonly format. If that file is a video or audio file, that's easy enough, but I'd like to be able to also do pdfs, word docs, maybe excel. Preferably it would be in a cross browser friendly way but if I need to do detection for a plugin (I've seen Google Docs Viewer for FF) I can live with that.

UPDATE:

ShaneC's answer is great and will work well in general. The one hitch I see is that for html5 devices (think ipad), I need to convert the document into a series of images. Is there any way for me to do this in an automated fashion? I need to be able to do this automatically when a new document is uploaded.

like image 318
Endophage Avatar asked Sep 02 '11 23:09

Endophage


People also ask

How do you preview a document as a Web page?

You can get an idea of how things will look by choosing the Web Page Preview option from the File menu. This is similar in purpose to the Print Preview option—it allows you to see what your document looks like before actually committing it to a final form.

How do I preview a document in HTML?

Just append your src attribute with an appropriate URL to a specific doc viewer, it will download your file from URL and then generate an HTML page from it, and then you direct your iframe to it and voila!

How do I preview documents?

Open File Explorer in Windows 10, click the View tab, and select Preview pane. Click a file you wish to view, such as a Word document, Excel sheet, PowerPoint presentation, PDF, or image. The file appears in the preview pane.

How do I view files in my browser?

From the document library select- Settings > Document Library Settings > General Settings > Advanced Settings > Browser-enabled Documents > Select the "Display as a Web page" option.


1 Answers

You'll want to integrate a cross-browser cross-type document viewer. Google will give you some good sites, personally I've had good experiences with Flex Paper.

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

like image 159
ShaneC Avatar answered Sep 23 '22 22:09

ShaneC