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.5 Star
(2)
1,809 times
Add to favorites
5/10/2019
E-mail Twitter del.icio.us Digg Facebook

Solution explorer

C#
@page
@model SelectPdf.Samples.Pages.ConversionDelayModel
@{
    Layout = "~/Pages/_Layout.cshtml";
    ViewData["Title"] = "SelectPdf Free Html To Pdf Converter for .NET Core - Conversion Delay with Html to Pdf Converter - C# / ASP.NET Core MVC6";
    ViewData["Description"] = "SelectPdf Conversion Delay with Html to Pdf Converter Sample for C# ASP.NET MVC. Pdf Library for .NET with full sample code in C# and VB.NET.";
    ViewData["Keywords"] = "conversion delay, navigation timeout example, pdf library, sample code, html to pdf, pdf converter";
}

<form method="post">
    <article class="post type-post status-publish format-standard hentry">
        <header class="entry-header">
            <h1 class="entry-title">SelectPdf Free Html To Pdf Converter for .NET Core - Conversion Delay with Html to Pdf Converter - C# / ASP.NET Core MVC6 Sample</h1>
        </header>
        <!-- .entry-header -->

        <div class="entry-content">
            <p>
                This sample shows how the html to pdf converter can be used to convert a web page to pdf using SelectPdf Pdf Library for .NET.
                <br />
                <br />
                For pages that use javascripts heavily, the conversion can be delayed a number of seconds using <i>converter.Options.MinPageLoadTime</i> property to allow the content to be fully rendered.
                <br />
                <br />
                In a similar way, if a page takes too much time to load, the converter can specify the amount of time in seconds when the page load will timeout using the property <i>converter.Options.MaxPageLoadTime</i>.
            </p>
            <p>
                Url:<br />
                <input type="text" value="https://selectpdf.com" asp-for="TxtUrl" style="width:90%" />

            </p>
            <div class="col2">
                Delay conversion:<br />
                <input type="text" value="2" asp-for="delay" style="width:50px" />
                seconds<br />
                <br />
            </div>
            <div class="col2">
                Page timeout:<br />
                <input type="text" value="20" asp-for="timeout" style="width:50px" />
                seconds<br />
                <br />
            </div>
            <div class="col-clear"></div>
            <p>
                <input type="submit" name="BtnConvert" value="Create PDF" class="mybutton" />
            </p>
        </div>
        <!-- .entry-content -->
    </article>
    <!-- #post -->
</form>