Gnostice XtremeDocumentStudio .NET Multi-format Document Viewer is the next-generation multi-format document-viewing technology for ASP.NET MVC developers. The DocumentViewer control supports viewing and printing PDF, DOCX, DOC, BMP, JPEG, PNG, WMF, EMF, and single-page and multi-page TIFF. It works in both desktop and mobile browsers.

Supported Formats





Client Side APIs
Properties  : 
 
Methods  :               
Events  :  OnPageChanged     Page Number:    
  • No browser plug-in
  • Compatible with all browsers
  • Single click Document printing on client printer
  • Save copy of Document on client computer (Note: Can be disabled)
  • Multipage continuously scrollable viewer
  • Painless implementation, customization and deployment
  • Fully customizable through APIs and client side object
  • Perform all operations through client side JavaScript when required
  • Supported Formats: PDF, DOCX, DOC, BMP, JPEG, PNG, WMF, EMF, and single-page and multi-page TIFF.

How to display documents in ASP.NET MVC applications?


Step 1:   Add the following references to your project:
  • Gnostice.Documents.Extensions.MVC.dll
  • Gnostice.Core.dll
  • Gnostice.Documents.dll
  • Gnostice.XtremeFontEngine.4.0.dll
  • Gnostice.XtremeImageEngine.dll
  • Ionic.Zlib.dll
  • Newtonsoft.Json (Version: 8.0.0.0)

Step 2:   Update Web.config file with the following settings:

  <system.web>
      <httpModules> 
          <add type="Gnostice.Documents.Extensions.MVC.ASPxHttpHandlerModule"
            name="ASPxHttpHandlerModule"/> 
      </httpModules>
  </system.web>

                        
<system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"> 
          <add type="Gnostice.Documents.Extensions.MVC.ASPxHttpHandlerModule"
            name="ASPxHttpHandlerModule"  />
      </modules>
  </system.webServer>

Step 3:   Add the following line to activate the license in Global.asax:

Gnostice.Documents.Framework.ActivateLicense("your-license-key");

Step 4:   Add the following line in Default View:

<%@ import namespace="Gnostice.Documents.Extensions.MVC" %>

<script src="../../Scripts/jquery-1.7.min.js"></script>
												
<% Html.Gnostice().RenderScripts(); %>
<% Html.Gnostice().RenderStyleSheets(); %>



<% DocumentViewerSettings oViewerSettings = new DocumentViewerSettings();
    oViewerSettings.Width = 800;
    oViewerSettings.Height = 600;
    oViewerSettings.ClientObjectName = "DocumentViewer1";
    oViewerSettings.EnableDBCaching = false;

    Html.Gnostice().
        DocumentViewer(oViewerSettings).
        LoadDocument(Server.MapPath("~/App_Data/") + "sample.docx").Render();
%>                        
Step 1:   Add the following references to your project:
  • Gnostice.Documents.Extensions.MVC.dll
  • Gnostice.Core.dll
  • Gnostice.Documents.dll
  • Gnostice.XtremeFontEngine.4.0.dll
  • Gnostice.XtremeImageEngine.dll
  • Ionic.Zlib.dll

Step 2:   Update Web.config file with the following settings:

  <system.web>
      <httpModules> 
          <add type="Gnostice.Documents.Extensions.MVC.ASPxHttpHandlerModule"
            name="ASPxHttpHandlerModule" /> 
      </httpModules>
  </system.web>

                        
<system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"> 
          <add type="Gnostice.Documents.Extensions.MVC.ASPxHttpHandlerModule"
            name="ASPxHttpHandlerModule"  />
      </modules>
  </system.webServer>

Step 3:   Add the following line to activate the license in Global.asax:

Gnostice.Documents.Framework.ActivateLicense("your-license-key");

Step 4:   Add the following line in Default View:

@using Gnostice.Documents.Extensions.MVC;

												
<script src="../../Scripts/jquery-1.7.min.js"></script>

@{
    Html.Gnostice().RenderStyleSheets();
    Html.Gnostice().RenderScripts();
}



@{ 
    DocumentViewerSettings oViewerSettings = new DocumentViewerSettings();
    oViewerSettings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
    oViewerSettings.Height = System.Web.UI.WebControls.Unit.Percentage(100);
    oViewerSettings.ClientObjectName = "DocumentViewer1";
    oViewerSettings.EnableDBCaching = false;
    Html.Gnostice().
        DocumentViewer(oViewerSettings).
        LoadDocument(Server.MapPath("~/App_Data/") + "sample_doc.pdf").Render();
}