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

Html to Pdf Conversion is now available for .NET Core. SelectPdf offers a Community Edition (FREE) of the powerful Html To Pdf Converter for .NET Core that can be found in the full featured pdf library.

C# (1.6 MB)
4.3 Star
2,052 times
Add to favorites
E-mail Twitter Digg Facebook

Solution explorer

<!DOCTYPE html>
        <title>Test document for SelectPdf Sample</title>
        <h1>SelectPdf Free Html To Pdf Converter for .NET Core - 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 SelectPdf 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="../js/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 () {