ASP.NET Web Document Viewer SDK Control

ASP.NET Web Document Viewer SDK Control

Platform : Windows 10, Windows 8, Vista, Windows 7

For ASP.NET Developer to view popular image format ,TIFF and PDF documents in web pages.
Navigate through TIFF, PDF document using Continuous scroll mode. Support Zoom, Print, Rotate the image.

Popular Solution Go   Back

ASP.NET - How to viewing documents in Web applications

1. Assuming that you have already run the ASP.NET Web Document Viewer SDK Control installation program and started visual studio 2019, the next step is create a new project, select ASP.NET Web Application(.NET Framework). Click Next.

2. Select Empty - selected Web Forms , click Create button.

3. In Toolbox, Right click the mouse, select Chooses Items...  , In .NET Framework Components, select Browse, select WebDocViewerControl.dll from C:\Program Files (x86)\ASP.NET Web Document Viewer SDK Control\bin folder, then click OK.

4. Select WebApplication1 in Solution Explorer, right click the mouse, select Add - New Items... , select Web Form, enter the Default.aspx name. then click Add.


5. Select default.aspx in Solution Explorer, selected source tab for view the html code.

6. In Toolbar, select WebDocumentViewer control icon, drag to default.aspx source code.


and We’re also going to use the Width and Height attributes to set the size of the web document viewer, but this is optional.

7. Open Windows Explorer, select "assets", "bigimage", "rotatedimage", "smallimage", "uploads" folder,  Drag these folde to your WebApplication1 in Solution Explorer.

After added the folders to WebApplication1 project.

8. Select Web.config, add the following code to Web.config.

<add name="GetNumImage.axd" path="GetNumImage.axd" verb="*" type="WebDocViewerControl.WebDocViewerHttpHandlerGetDocPages" resourceType="Unspecified" requireAccess="Script" />
<add name="UploadImage.axd" path="UploadImage.axd" verb="*" type="WebDocViewerControl.WebDocViewerHttpHandlerUpload" resourceType="Unspecified" requireAccess="Script"/>
<add name="ConvertImage.axd" path="ConvertImage.axd" verb="*" type="WebDocViewerControl.WebDocViewerHttpHandlerConvertImage" resourceType="Unspecified" requireAccess="Script"/>
<add name="ExportImage.axd" path="ExportImage.axd" verb="*" type="WebDocViewerControl.WebDocViewerHttpHandlerExportImage" resourceType="Unspecified" requireAccess="Script"/>

Here is an example of the web.config

if you need to upload big images, you can specify the maximum file upload size supported by ASP.NET at Web.config, The default size is 4096 KB (4 MB)
 e.g. add the following code to Web.config, let you upload 100M file size.

<httpRuntime targetFramework="4.7.2" executionTimeout="240" maxRequestLength="102400"/>

<compilation debug="true" targetFramework="4.7.2"/>
<httpRuntime targetFramework="4.7.2" executionTimeout="240" maxRequestLength="102400"/>


9. press F5 or click the green color arrow icon to run the project.

10. After run the project, you will see the web document viewer. You can click open button to select the image or TIFF or PDF file.