Click or drag to resize

PdfIntegrationProvider Class

Defines the contract that RAD PDF implements to specify settings and provide features using custom integration providers.
Inheritance Hierarchy

Namespace:  RadPdf.Integration
Assembly:  RadPdf (in RadPdf.dll) Version: 3.26.0.0 (3.26.0.0)
Syntax
public abstract class PdfIntegrationProvider

The PdfIntegrationProvider type exposes the following members.

Constructors
  NameDescription
Public methodPdfIntegrationProvider
Creates a new instance of the PdfIntegrationProvider class.
Top
Properties
  NameDescription
Public propertyCode exampleAdvancedSettings
Gets an object that specifies the HTTP settings used with RAD PDF applications using this integration provider.
Public propertyStatic memberCurrent
Gets a reference to the current PdfIntegrationProvider being used by this code.
Public propertyCode exampleFontResources
Gets an object that specifies the font resources available in RAD PDF applications using this integration provider.
Public propertyCode exampleHttpSettings
Gets an object that specifies the HTTP settings used with RAD PDF applications using this integration provider.
Public propertyCode exampleLicense
Gets or sets an object that represents the Red Software issued license currently used by RAD PDF applications using this integration provider.
Public propertyCode exampleLiteSessionProvider
Gets or sets an object that specifies the session provider used for Lite Documents with RAD PDF applications using this integration provider.
Public propertyCode exampleLiteStorageProvider
Gets or sets an object that specifies the storage provider used for Lite Documents with RAD PDF applications using this integration provider.
Public propertyCode examplePdfWebControlResources
Gets or sets a ResourceManager used by the PdfWebControl for visible resources (e.g. text strings used in the interface).
Public propertyCode exampleStorageProvider
Gets an object that specifies the storage provider used with RAD PDF applications using this integration provider.
Public propertyCode exampleWcfSettings
Gets an object that specifies the WCF settings used with RAD PDF applications using this integration provider.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodOnDocumentAppending
Called before a document is appended.
Public methodOnDocumentCreated
Called after a document is created.
Public methodCode exampleOnDocumentDownloading
Called before a document is downloaded.
Public methodCode exampleOnDocumentInit
Called before a document is loaded, as the document interface is initializing.
Public methodCode exampleOnDocumentPrinting
Called before a document is printed.
Public methodCode exampleOnDocumentSaved
Called after a document is saved.
Public methodCode exampleOnDocumentSaving
Called before a document is saved.
Public methodCode exampleOnDocumentSearching
Called before a document is searched.
Public methodOnDocumentUploading
Called before a document is uploaded into an empty PdfWebControlLite instance.
Public methodCode exampleOnHttpHandlerException
Called when an exception occurs in a call to the PdfHttpHandler configured.
Public methodCode exampleOnObjectDataAdding
Called before an object's data (e.g. the image data for an PdfImageShape object) is added.
Public methodOnPageRenderOnDemand
Called before an page is rendered on demand.
Public methodCode exampleProcessAppendDataRequest
Called when processing a request for object data initiated by the Client API which set the user mode to object insertion with a custom object key.
Public methodCode exampleProcessObjectDataRequest
Called when processing a request for object data initiated by the Client API which set the user mode to object insertion with a custom object key.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks
To specify a custom Integration Provider, override PdfIntegrationProvider and the desired members, then register it in the appropriate web.config file. If a custom Integration Provider is not registered in a web application's web.config file, DefaultPdfIntegrationProvider is used.
Examples
The following example overrides the default PdfIntegrationProvider to create a custom Integration Provider for the web application.
C#
using System;
using System.Web;

using RadPdf.Data.Document.Objects.Shapes;
using RadPdf.Integration;

public class CustomPdfIntegrationProvider : PdfIntegrationProvider
{
    public override void OnObjectDataAdding(ObjectDataAddingEventArgs e)
    {
        base.OnObjectDataAdding(e);

        //if data is added to an image
        if (e.PdfObjectType == typeof(PdfImageShape))
        {
            //check image size (if larger than 1 MB)
            if (e.Data.Length > 0x100000)
            {
                e.Cancel = true;
                e.CancelMessage = "Maximum image size is 1 MB.";
            }
        }
        else
        {
            throw new ArgumentException("PdfObjectType unsupported.");
        }
    }
}
The following web.config file registers the above custom Integration Provider. This example assumes that CustomPdfIntegrationProvider is in the directory App_Code of your ASP.NET web application.
XML
<?xml version="1.0"?>
<configuration>
  <appSettings>
    <add key="RadPdfConnectionString" value="Server=.\SQLExpress;Database=RadPdf;Trusted_Connection=Yes;"/>
    <add key="RadPdfLicenseKey" value="DEMO"/>
    <add key="RadPdfIntegrationProvider" value="CustomPdfIntegrationProvider,App_Code"/>
  </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="PdfHttpHandler" preCondition="integratedMode" type="RadPdf.Web.HttpHandler.PdfHttpHandler"/>
    </handlers>
  </system.webServer>
</configuration>
See Also