Click here to Skip to main content
14,734,526 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

I need to preview Doc, Xls, PPT, MHT, TIFF, DWG files in my web browser (same as pdf files open in browser using acrobat reader).

I has searched a lot on google, but not got any help. If anyone can suggest me how can I start this, it will be a great help.

Thanks in advance.

Richa Sharma

This is not an easy or trivial solutions. Save for the MHT those are proprietary file formats that are not meant to be displayed in a browser.

I would start with each of the producers of the files you needing to view, but I doubt you will have much luck.
First of all, you don't "preview" PDF's the way you described, Adobe Acrobat Reader has a plugin that is instanciated by the browser to show the content of the PDF. Likewise, Chrome has it's own PDF reader.
You can use different plugins to "embed" the different viewers in your application. But you will need to install them all on the client side.

But this approach is no preview. And neither is it cross-browser, or cross-platform. And as HTML5 goes in a plugin-less direction, it is not future-proof either.

If you really need a preview, you need to render those files as image on the server and send that image to the client.

I suggets you look for some commercial library or command line tool, that you can call on server side from c# and create actual preview images (PNG) at the time those files are uploaded. With TIFF you don't need such thing as it is supported by .net, so you have everything to convert it to png.

You can try to find free/open source tools for that, but I doubt you will find any.
These are some commetcial options:[^][^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900