Visual C#.NET - How to View, Operate Doc Online

C# Guide on How to View, Operate Document & Image Files Online
Yiigo.Image for .NET provides powerful imaging functionality for developers and users, so they are enabled to view, annotate, resize, edit, convert and print document and images in C# & VB.NET projects in .NET as well as ASP.NET web applications. Various file formats are supported including jpeg, png, gif, tiff, docx, xlsx, ppt, txt, html and many more.
To help users easily view documents online, this component SDK offers Yiigo Document Web Viewer, Image Web Viewer and Annotation Web Viewer, so you can freely open/display document with any browser, and at the same time, make all kinds of annotations as you wish. Follow the guide below to learn how to view and operate documents online.
C# Guide - How to View, Operate Document Online

C# Image Web Viewer & Operator - Requirements

  • First please install Microsoft Visual Studio 2005 or later versions / Visual Studio Express.
  • Make sure you are using Visual C#.NET 2.0 or later versions.

C# Image Web Viewer & Operator - Preparation

  • Download .NET image package: Download online the Yiigo.Image for .NET evaluation package or the purchased product.
  • Install .NET image package: Install the imaging software by unzipping and running the exe file from the download SDK.
  • Activate .NET image license: Activate the license by typing in your purchased serial number, or requesting a 30-day evaluation license.

C# Image Web Viewer & Operator - Integration

  • Create an imaging project: Start your Visual Studio and create an empty C# ASP.NET web form.
  • Add reference: Add the Yiigo.Image.dll from the unzipped file to your project reference.
  • Add project resources: Add the C:\Program Files\Yiigo.Image for .NET\bin\WebResources\WebDocument\Viewer to your project resources by copying it your project folder.
  • Add Web Page: Add a Generic Handler and a Web Form to your .NET imaging project.
  • Deploy to IIS: Copy your project folder to your IIS document, convert your project directory to application and assign it to an Application Pool.

C# Image Web Viewer & Operator - View, Operate Online

  • To view, operate images online, you should firstly load a file from the browser.
  • Save the file in the file cache for later operation & manipulation.
  • Load the file into your web viewer control for displaying and processing.
  • Copy the following Visual C# sample code to your project for evaluation.
  • Now you can view the file online and make necessary operations on the document, such as resizing, converting, panning, zooming, searching, tiling and so on.
using System;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.HtmlCOntrols;
using Yiigo.Imaging;
using Yiigo.Imaging.Processing;
namespaceDotImageWebControlsDemo
{
///<summary>
///SummarydescriptionforWebForm1.
///</summary>
publicclassWebForm1:System.Web.UI.Page
{
protectedYiigo.Imaging.WebControls.WebImageViewerWebImageViewer1;
protectedSystem.Web.UI.WebControls.ButtonButton1;
protectedSystem.Web.UI.WebControls.LabelLabel1;
protectedSystem.Web.UI.HtmlControls.HtmlInputFileFile1;
privatevoidPage_Load(objectsender,System.EventArgse)
{
//Put user code to initialize the page here
}
///<summary>
//Save uploaded file to server
File1.PostedFile.SaveAs(fullPath+fileName);
}
catch(Exceptionexc)
{
Label1.Text="Errorsavingfile<b>"+cachePath+fileName+
"</b><br>"+exc.Message;
}
try
{
//Set main viewer to the users image
WebImageViewer1.OpenUrl(cachePath+fileName);
}
catch(Exceptionexc)
{
Label1.Text="Erroropeningfile<b>"+cachePath+fileName+
"</b><br>"+exc.Message;
}
}
else
Label1.Text="Error:Youmustspecifyafilename.";
}
}
}
{
See More Articles about C#.NET Web Document Viewer
Products
Other Plugins
Image Viewer CoreBarcode PluginPDF Read & WriteTesseract OCR PluginForm Processing PluginJBIG2 CodecJPEG2000 CodecISIS ScannerTwain ScannerDICOM ReaderCAD Scanner