    protected void convertToPdfButton_Click(object sender, EventArgs e)
    {
        // Create a HTML to PDF converter object with default settings
        HtmlToPdfConverter htmlToPdfConverter = new HtmlToPdfConverter();

        // Set license key received after purchase to use the converter in licensed mode
        // Leave it not set to use the converter in demo mode
        htmlToPdfConverter.LicenseKey = "4W9+bn19bn5ue2B+bn1/YH98YHd3d3c=";

        // Enable extensions including the Flash support
        // The converter does not have a built-in Flash player and it uses the installed Flash plugin
        // for Google Chrome or Mozilla Firefox
        htmlToPdfConverter.ExtensionsEnabled = extensionsEnabledCheckBox.Checked;

        // Set an adddional delay in seconds to wait for Flash to run
        // Set this property to 0 if you want to start conversion immediately
        htmlToPdfConverter.ConversionDelay = int.Parse(conversionDelayTextBox.Text);

        // Convert the HTML page with Flash to a PDF document in a memory buffer
        byte[] outPdfBuffer = htmlToPdfConverter.ConvertUrl(urlTextBox.Text);

        // Send the PDF as response to browser

        // Set response content type
        Response.AddHeader("Content-Type", "application/pdf");

        // Instruct the browser to open the PDF file as an attachment or inline
        Response.AddHeader("Content-Disposition", String.Format("attachment; filename=Flash_to_PDF.pdf; size={0}", outPdfBuffer.Length.ToString()));

        // Write the PDF document buffer to HTTP response
        Response.BinaryWrite(outPdfBuffer);

        // End the HTTP response and stop the current page processing
        Response.End();
    }