Click here to Skip to main content
14,668,708 members
Rate this:
Please Sign up or sign in to 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
Posted

Rate this:
Please Sign up or sign in to vote.

Solution 1

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.
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

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 asp.net 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:
http://rainbowpdf.com/server-based-converter/[^]
https://www.woutware.com/cadlib/4.0[^]
   
v2

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100