Getting Started Guide

Before you proceed, please be aware that this project is built based on the GroupDocs.Viewer for .NET library which is not free. In order to setup and run the project, you will need to download the GroupDocs.Viewer for .NET library (free evaluation) from this page. You can use the evaluation version as is, but we recommend you to contact GroupDocs sales for a free 30-day license to be able to test the viewer without any restrictions.

The sample represents a simple ASP.NET WebForms project that uses .NET Framework 4.0. It can be opened in Microsoft Visual Studio 2012 or higher.

Once you downloaded an evaluation copy of the GroupDocs.Viewer for .NET library (Groupdocs.Viewer.dll), place it into the “GroupDocsViewerWebFormsSample\libs” folder. 

A root storage path is specified via the Application_Start method which can be found in the Global.asax file. This is mandatory for the GroupDocs.Viewer to operate. You can also configure a log file path and set a license file here. Without the license GroupDocs.Viewer works in evaluation mode.

Simply compile and run the project. Once this is done, you should see a start page (Default.aspx) with a list of sample documents in your browser.

The sample has a sort of repository (the FileRepository class) that checks the “App_Data” folder and returns a list of files located there. The list of available files is then displayed on the start page (Default.aspx).

The project comes with several sample documents located in the “App_Data” folder. They are: “candy.pdf” and “Sample_2SpreadSheet.xlsx”. You can delete them and add your own documents there.

When clicking the “Open” link on the start page, a new page - Viewer.aspx - should be opened displaying the selected document within the GroupDocs.Viewer widget (UI).

On the Viewer.aspx page you will find all the widget’s JavaScript, CSS libraries and scripts in the HEAD block. The GroupDocs.Viewer widget itself (<%= Viewer.ClientCode().TargetElementSelector("#viewer")…) is located In the BODY block. When the web-page is opened, this widget is transformed to the JavaScript code, which invokes GroupDocs.Viewer, then creates a viewport and fills it with the content of the document obtained from the server. At the end of the Viewer.aspx page there is a JS code that dynamic resizes the GroupDocs.Viewer viewport.

In order to stream documents from the server, GroupDocs.Viewer sends asynchronous requests to the client. All the necessary HTTP-handlers can be found in the web.config file. But if you use ASP.NET MVC, there is no need to specify all these handlers - you can simply invoke the Groupdocs.Web.UI.Viewer.InitRoutes() method that does the same thing.

For more details on GroupDocs.Viewer for .NET library, please visit the products page at:
http://groupdocs.com/dot-net/document-viewer-library

Last edited Sep 16, 2015 at 12:52 PM by GroupDocs, version 6