Click or drag to resize

PdfIntegrationProviderProcessAppendDataRequest Method

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.

Namespace:  RadPdf.Integration
Assembly:  RadPdf (in RadPdf.dll) Version: (
public virtual void ProcessAppendDataRequest(
	PdfDataContext context


Type: RadPdf.IntegrationPdfDataContext
An object (defined by PdfDataContext) that contains the request context.

If this method is overridden in an inheriting class, do not call this base method.

This method is not triggered by Append(Byte) or similar overloads.

The following example overrides the default PdfIntegrationProvider to create a custom Integration Provider for use with ProcessObjectDataRequest in a web application.
using System;
using System.Web;

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

public class CustomPdfIntegrationProvider : PdfIntegrationProvider
        public override void ProcessAppendDataRequest(PdfDataContext context)
            switch (context.Request.DataKey)
                case "my_key":
                    //Write a file to the response
                    //Alternatively, we could also use the .Write method to write data from almost any source (e.g. database, memory, generated on the file)
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 version="1.0"?>
    <add key="RadPdfConnectionString" value="Server=.\SQLExpress;Database=RadPdf;Trusted_Connection=Yes;"/>
    <add key="RadPdfLicenseKey" value="DEMO"/>
    <add key="RadPdfIntegrationProvider" value="CustomPdfIntegrationProvider,App_Code"/>
      <add path="RadPdf.axd" verb="GET,POST" type="RadPdf.Web.HttpHandler.PdfHttpHandler"/>
    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.
    <validation validateIntegratedModeConfiguration="false"/>
      <add path="RadPdf.axd" verb="GET,POST" name="PdfHttpHandler" preCondition="integratedMode" type="RadPdf.Web.HttpHandler.PdfHttpHandler"/>
The following aspx and code behind files use the the client API to allow server side provided images to be added to a document.
using System;

partial class _Default : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)
        if (!IsPostBack)
            //Get PDF as byte array from file (or database, browser upload, remote storage, etc)
            byte[] pdfData = System.IO.File.ReadAllBytes(@"C:\demo.pdf");

            //Load PDF byte array into RAD PDF
            this.PdfWebControl1.CreateDocument("Document Name", pdfData);
<%@ Page Language="C#" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="RadPdf" Namespace="RadPdf.Web.UI" TagPrefix="radPdf" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="" >
<head runat="server">
    <title>RAD PDF Sample</title>
    <script type="text/javascript">
    function DoAppendPdfData()
        //get id
        var id = "<%= PdfWebControl1.ClientID%>";

        //get api instance
        var api = new PdfWebControlApi(id);

        //do append using a key
    <form id="form1" runat="server">
        <radPdf:PdfWebControl id="PdfWebControl1" runat="server" height="600px" width="100%" />
        <a href="#" onclick="DoAppendPdfData(); return false;">Append PDF Data</a>
See Also