Guide for C#
View TIFF Document Online
Core Document Formats
Additional Features

C# Imaging - Tutorial: View TIFF Document Online

Online View Document from Database Repository in C# ASP.NET Web Class

Visual C#
Home > .NET Imaging SDK > C# > Tutorial: View TIFF Document Online
If this is your first time to use our DocImageSDK, we strongly suggest you reading How to Start first!

RasterEdge DocImage SDK for .NET is a mature and professional .NET imaging SDK, consisting of several advanced image capturing, image processing, image displaying, image tracking and image annotating library control toolkits. This C#.NET imaging SDK has been widely used in modern n-tire enterprise document management system with the purpose to automate the time-consuming document processing applications.
Related .net document control helps:
asp.net pdf viewer control: ASP.NET PDF Viewer Control: view, navigate, zoom Adobe PDF document in C# ASP.NET
asp.net edit pdf image: ASP.NET PDF Image Edit Control: online insert, edit PDF images in C#
asp.net ppt viewer: ASP.NET PowerPoint Document Viewer Control (MVC & WebForms): view ppt, pptx files online in C# using ASP.NET
asp.net mvc text file viewer: ASP.NET Text file viewer in MVC, WebForms: Open, view, annotate, convert txt files in C# ASP.NET
asp.net multipage tiff viewer: ASP.NET Tiff Viewer: view, annotate multipage Tiff images in ASP.NET MVC, WebForms using C# Control
asp.net edit pdf page: ASP.NET PDF Pages Edit Control: add, remove, sort, replace PDF pages online using C#
sharepoint document viewer: ASP.NET SharePoint Document Viewer: view, annotate, redact documents in SharePoint
This article will illustrate how to develop an ASP.NET class application to navigate and view documents stored in the database. Thus, before you read this article, make sure you have built a capture client to submit documents to a centralized server through web services. And you can build the database in SQL Express and create the data extraction tire in Microsoft Visual Studio 2005 or above.
As this ASP.NET web viewing application will be used by numerous users, thus, a document displaying application with zero footprint features will be quite useful for reducing the money spent in the system deployment and maintenance.
This tutorial page for how to view TIFF document in web site application consists of five parts.
  • Deploy a website to use the RasterEdge's web viewer add-on
  • Create WebThumbnailViewer and WebAnnotationsViewer
  • Add a drop-down list to navigate documents stored in the database
  • Load documents from database to ASP.NET web viewer
  • Add no-postback navigation controls to web viewer
Deploy a Website for RasterEdge Web Viewing Application
You can configure a website to use the web viewer add-on from RasterEdge DocImage SDK for .NET by adding the ASP.NET WebForm controls to the project and deploying the ImageCache.Following are detailed steps for website configuration.
  1. Provide ASP.NET web user modify access to the project folder;
  2. Replace the content of the appSetting section in the web.config with following XML, after which, you can specify where the ImageCache exists and determine the time that the images will be kept in the cache.
<add key="RasterEdgeWebControls_Cache" value="ImageCache/"/>
<add key="RasterEdgeWebControls_CacheLifeTime" value="60"/>
Create WebThumbnailViewer and WebAnnotationsViewer
You can add a WebThumbnailViewer and a WebAnnotationsViewer to the project by simply dragging and dropping a WebThumbnailViewer and a WebAnnotationsViewer from the Visual Studio Toolbox onto the Form. Then you need to adjust the properties of created ThumbnailViewer and connect the viewer with the thumbnails.

Define the ThumbnailViewer Properties

  1. Place the ThumbnailViewer at the left side of the Annotation Viewer using tables;
  2. Set the width value of the ThumbnailViewer to 150px and that of AnnotationViewer to 100%;
  3. Set the height of both ThumbnailViewer and AnnotationViewer to 500px.
Now these two viewer controls can be positioned and resized properly.

Connect the Viewer with the Thumbnails

To connect the Viewer with the Thumbnails, type WebAnnotationViewer1 into the ViewerID property of the WebThumbnailViewer1. And then you can automatically display and view the associated image in the viewer with a click on a thumbnail.
After setting the ViewerID property of the WebThumbnailViewer, you will find the HTML code for the viewers shown in the way below.
< table > < tr > <td> <cc1:WebThumbnailViewer
ID="WebThumbnailViewer1" runat="server" Width="150px"
Height="500px" ViewerID="WebAnnotationViewer1" /> </td> <td
style="width:100%"> <cc2:WebAnnotationViewer
ID="WebAnnotationViewer1" runat="server" Height="500px"
Width="100%" /> </td> </ tr > </ table >
Navigate Document Using a Data-Bound Drop-Down List
You can achieve fast document navigation from the database via a data-bound drop-down list.
  1. Add a drop-down list to the page using the Visual Studio toolbox;
  2. Bind the list with all documents stored in the database repository;
  3. Open the drop-down list's designer and change the Data Source to use the SQL Database, the ImageDatabaseConnectionString and an SQL statement that selects all from the ImageDatabase;
  4. Set the display field to Name and the value field to ImageId;
  5. Select EnableAutoPostback to get a new document whenever the drop-down value is changed.
Load Documents from Database into Web Viewer
  1. Write a method that loads the image into the WebThumbnailViewer from DBImageSource, an ImageSource object you need to create;
  2. Create the static callback method for getting the connection for the above method to Work;
  3. Call the LoadImage() method when the drop-down changes.
Add No-Postback Navigation Controls to Viewer
  1. Add two HTML buttons, btnFitToWidth and btnViewFullSize to your form;
  2. Double-clicking on a button adds its event handler in JavaScript.


Recommend this to Google+


RasterEdge.com is professional provider of ASP.NET MVC Document Viewer, ASP.NET PDF Viewer, MVC PDF Viewer document, content and imaging solutions, available for ASP.NET AJAX, Silverlight, Windows Forms as well as WPF. We are dedicated to provide powerful & profession imaging controls, PDF document, image to pdf files and components for capturing, viewing, processing, converting, compressing and stroing images, documents and more.

©2000-2017 Raster Edge.com