Gnostice PDFOne.NET PDF Viewer is the next-generation PDF-viewing technology for ASP.NET MVC developers. The PDFViewer control supports viewing and printing PDF documents. It works in both desktop and mobile browsers.





Client Side APIs
Properties  : 
 
Methods  :               
Events  :  OnPageChanged     Page Number:    
  • No browser plug-in
  • Compatible with all browsers
  • Single click PDF printing on client printer
  • Save copy of PDF 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

How to display PDF documents in ASP.NET MVC applications?


Step 1:   Add the following references to your project:
  • Gnostice.PDFOne.Extensions.MVC.dll
  • Gnostice.PDFOne.dll
  • Gnostice.XtremeFontEngine.dll
  • Gnostice.XtremeImageEngine.dll
  • Ionic.Zlib.dll
  • BouncyCastle.Crypto.dll

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

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

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

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

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

Step 4:   Add the following line in Default View:

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

<% Html.Gnostice().RenderScripts(); %>
<% Html.Gnostice().RenderStyleSheets(); %>

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

<% PDFViewerSettings settings = new PDFViewerSettings();
    settings.Width = 800;
    Settings.Height = 600;
    settings.ClientObjectName = "pdfviewer1";
    settings.EnableDBCaching = false;

    Html.Gnostice().
        PDFViewer(settings).
        LoadDocument(Server.MapPath("~/App_Data/") + "sample.pdf").Render();
%>                        
Step 1:   Add the following references to your project:
  • Gnostice.PDFOne.Extensions.MVC.dll
  • Gnostice.PDFOne.dll
  • Gnostice.XtremeFontEngine.dll
  • Gnostice.XtremeImageEngine.dll
  • Ionic.Zlib.dll
  • BouncyCastle.Crypto.dll

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

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

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

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

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

Step 4:   Add the following line in Default View:

@using Gnostice.PDFOne.Extensions.MVC;

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

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

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