Surendra Sharma

Surendra Sharma

Search This Blog

Thursday, August 29, 2013

How to show different type of documents in ASP.NET webpage

To view different type of file, particular software is required.

Suppose if your website have word documents, client must have MS-Office software to view it. Similarly to show PDF, Adobe Acrobat is required.

In this way there can be thousands type of file format, will you install all these software to view particular type of file?

Problem. Very serious problem.

How nice if I use only one tool and can view any file as below

What is the solution?

Use online document viewer.

The beauty of online viewer is that no need to purchase different type of software on Web Server or client side.
You don't need to upload your file to their server.

The one online document viewer that I like is

They allow to embed document viewing in your site, blog or social media. They supports  300+ file types, play self-running slideshows, all while keeping them on your server and in your control and no installation required.

It also supports various online features like zoom , print, navigate, copy , save , fill screen, search etc.

How to use it?

First register free yourself on

After successful registration you will receive your KEY.

Now we can use their service by passing KEY and document URL as a query string to their cloud server at

Example 1 :- Use below URL with query string as below

·         key = Your key number
·         document = Any valid URL of document

Other supported optional query strings are

·         viewertype = flash or HTML5
·         viewerheight = viewer height in pixel
·         viewerwidth = viewer width in pixel
·         printButton = Yes or No
·         toolbarColor = colour code like CCCCCC

How to use it in ASP.NET webpage?

Use frame tags in your ASP.NET page like

<iframe width="700" height="650" src="">
Use below ASPX code for displaying PDF file in document viewer as shown in above image

<html xmlns="">
<head runat="server">
    <form id="form1" runat="server">
        <iframe width="700" height="650" src="">
            <p>Your browser does not support frames.</p>

Please leave your comments or share this tip if it’s useful for you.

No comments:

Post a Comment