Convert from HTML to PDF in CSharp VB and ASP.NET with a Free 3rd Party Library

Converting from html to pdf is not an easy task. There are some tools that can do that, but most of them cost thousands of dollars. SelectPdf offers a Community Edition (FREE) of the powerful Html To Pdf Converter for .NET that can be found in the full featured pdf library.

3.6 Star
52,991 times
Add to favorites
E-mail Twitter Digg Facebook

Solution explorer

<!DOCTYPE html>
        <title>Test document for Select.Pdf Sample</title>
        <h1>Select.Pdf for .NET - Start Conversion from Javascript</h1>
            This is a sample page that will demonstrate how a html to pdf conversion can be triggered from a javascript call using Select.Pdf Library for .NET.
            <br />
            The page increments a timer until it reaches 3 and then it calls the conversion from javascript. 
            If the conversion is manually started from javascript, the timer below should be 3 in pdf. If the conversion is automatically started when the page loads, the timer below should be 1 in pdf.
            Library version: <span id="idVersion"></span><br />
            Timer: <span id="idTimer"></span><br />

        <script type="text/javascript" src="jquery.js"> </script>
        <script type="text/javascript">
            var timer = 0;

            function incrementTimer() {
                timer = timer + 1;

                if (typeof (selectpdf) == "object") {
                else {
                    $("*#idVersion").html("Not in converter.");

                if (timer == 3) {
                    // 3 seconds elapsed - start conversion
                    if (typeof (selectpdf) == "object") {
                else {
                    // wait another second
                    setTimeout("incrementTimer()", 1000);


            $(document).ready(function () {