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.
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.
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!
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.
From the document library select- Settings > Document Library Settings > General Settings > Advanced Settings > Browser-enabled Documents > Select the "Display as a Web page" option.
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With