Click or drag to resize

ASP.NET Setup for .NET Framework 3.5 / 4.x

ASP.NET setup for RAD PDF requires a reference to the RadPdf.dll in your web application and minor changes to your site's web.config file.

Web Control Installation

Copy RadPdf.dll into the bin directory of your web application. Assuming RAD PDF was installed in the default location and a system disk of C, this DLL should be in the directory:

C:\Program Files\RAD PDF\WebControl

RAD PDF can also be installed into your Visual Studio toolbox by right clicking the toolbox and selecting "Choose Items..." and selecting the RadPdf.dll

Web Control web.config Requirements

In order to use the RAD PDF Web Control, additions will need to be made to your web application's web.config file.

HTTP Handler

For IIS 6 (or IIS 7+ with Managed Pipeline Mode set to "Classic"), the httpHandlers element of the system.web element must contain:

XML
<add path="RadPdf.axd" verb="GET,POST"
 type="RadPdf.Web.HttpHandler.PdfHttpHandler" />

For IIS 7 (and later) with Managed Pipeline Mode set to "Integrated", the handlers element of the system.webServer element must contain:

XML
<add path="RadPdf.axd" verb="GET,POST" 
 name="RadPdfHandler"
 preCondition="integratedMode"
 type="RadPdf.Web.HttpHandler.PdfHttpHandler" />

This will add RAD PDF as the http handler for all requests to the URL RadPdf.axd.

App Settings

Required App Settings

The appSettings element of the configuration element must contain the following keys:

  • RadPdfLicenseKey – This key must contain the server license key provided by Red Software. If evaluating RAD PDF, "DEMO" should be used.
    XML
    <add key="RadPdfLicenseKey" value="YOUR LICENSE KEY" />

Optional App Settings

The appSettings element of the configuration element may contain the following keys:

  • RadPdfConnectionString – This key must contain a value which is a valid connection string to a SQL Server instance. This connection string must contain the name of the database which RAD PDF should use (e.g. RadPdf). This key is only required if using the PdfWebControl. The PdfWebControlLite does not use SQL Server.
    XML
    <add key="RadPdfConnectionString" 
     value="Server=.\SQLExpress;Database=RadPdf;Trusted_Connection=Yes;" />
  • RadPdfIntegrationProvider – This optional key registers a custom Integration Provider. The value of this key must be the assembly-qualified name of a Type which implements the abstract class PdfIntegrationProvider. This value should be a fully qualified name of a class in the format:
    TopNamespace.SubNameSpace.ContainingClass+NestedClass,MyAssembly

    For example, to register a custom Integration Provider class with the type name CustomPdfIntegrationProvider located in an assembly with the name MyAssembly, a value of "CustomPdfIntegrationProvider,MyAssembly" should be used.

    XML
    <add key="RadPdfIntegrationProvider" 
     value="CustomPdfIntegrationProvider,MyAssembly" />

    For example, to register a custom Integration Provider class with the type name CustomPdfIntegrationProvider located in your web application's App_Code directory, a value of "CustomPdfIntegrationProvider,App_Code" should be used.

    XML
    <add key="RadPdfIntegrationProvider" 
     value="CustomPdfIntegrationProvider,App_Code" />

    To use the default Integration Provider, a value of "DefaultPdfIntegrationProvider" should be used or the key left absent from the web.config file.

    XML
    <add key="RadPdfIntegrationProvider" 
     value="DefaultPdfIntegrationProvider" />

Legacy App Settings

Note Note

These legacy settings are provided for backwards compatibility with previous versions of RAD PDF. They will be removed in a future version and should not be used in new applications.

The appSettings element of the configuration element may contain the following legacy keys if using the DefaultPdfIntegrationProvider (or no integration provider is specified in PdfIntegrationProvider):

  • RadPdfDocumentOverheadMax – This legacy key can limit the size of a document's storage overhead (the space taken up by objects and images added to a document). To limit document overhead, a value of "x" should be used, where x is the maximum overhead per document in bytes. To not limit document overhead, a value of "0" should be used (default). (NOTE: This setting does not limit the size of PDF files loaded, only the content added to a document by users via the web browser.)
    XML
    <add key="RadPdfDocumentOverheadMax" 
     value="1048576" />
  • RadPdfHttpCompression – This legacy key can enable or disable HTTP Compression (GZip / Deflate) for requests handled by the PdfHttpHandler. By default (or if not specified), HTTP Compression is enabled. To disable, a value of "0" should be used.
    XML
    <add key="RadPdfHttpCompression" 
     value="1" />
  • RadPdfSearchTermMin – This legacy key can specify the minimum number of letters which a search term must contain in order to be used to search a PDF document. By default (or if not specified), no minimum is enforced (as if a value of "0" is specified).
    XML
    <add key="RadPdfSearchTermMin" 
     value="3" />
  • RadPdfServiceLocation – This legacy key can contain the location and port of the RAD PDF System Service. By default (or if not specified), the value "localhost:18104" is used.
    XML
    <add key="RadPdfServiceLocation" 
     value="localhost:18104" />

Web Site Sample web.config

The following is a sample web.config file for use in IIS 6, 7, 7.5, 8, and 8.5:

XML
<?xml version="1.0"?>

<configuration>
    <appSettings>
        <add key="RadPdfConnectionString" 
          value="Server=.\SQLExpress;Database=RadPdf;Trusted_Connection=Yes;" />
    <add key="RadPdfLicenseKey" value="YOUR LICENSE KEY" />
    </appSettings>
    <system.web>
        <httpHandlers>
            <add path="RadPdf.axd" verb="GET,POST" 
              type="RadPdf.Web.HttpHandler.PdfHttpHandler" />
        </httpHandlers>
    </system.web>
    <!--
    The system.webServer element is for use with IIS 7 (and later) when Managed Pipeline Mode is set to "Integrated".
    It will be ignored in other versions of IIS.
    -->
    <system.webServer>
      <validation validateIntegratedModeConfiguration="false" />
        <handlers>
            <add path="RadPdf.axd" verb="GET,POST" 
              name="RadPdfHandler"
              preCondition="integratedMode"
              type="RadPdf.Web.HttpHandler.PdfHttpHandler" />
        </handlers>
    </system.webServer>
</configuration>

See Also