    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=";

        // Set the conversion triggering mode
        if (autoRadioButton.Checked)
        {
            // Set Auto triggering mode
            htmlToPdfConverter.TriggeringMode = TriggeringMode.Auto;
        }
        else if (delayedRadioButton.Checked)
        {
            // Set delayed triggering moe
            htmlToPdfConverter.ConversionDelay = int.Parse(conversionDelayTextBox.Text);
        }
        else if (manualRadioButton.Checked)
        {
            // Set manual triggering mode
            // The conversion starts when the evoPdfConverter.startConversion() is called
            // in JavaScript code of the converted HTML page
            htmlToPdfConverter.TriggeringMode = TriggeringMode.Manual;
        }

        byte[] outPdfBuffer = null;

        if (convertHtmlRadioButton.Checked)
        {
            string htmlWithForm = htmlStringTextBox.Text;
            string baseUrl = baseUrlTextBox.Text;

            // Convert the HTML string with page-break-inside:avoid styles to a PDF document in a memory buffer
            outPdfBuffer = htmlToPdfConverter.ConvertHtml(htmlWithForm, baseUrl);
        }
        else
        {
            string url = urlTextBox.Text;

            // Convert the HTML page with page-break-inside:avoid styles to a PDF document in a memory buffer
            outPdfBuffer = htmlToPdfConverter.ConvertUrl(url);
        }

        // 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=Conversion_Triggering_Modes.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();
    }