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

Solution explorer

C#
@page
@model SelectPdf.Samples.Pages.HtmlToPdfConverterModel
@{
    Layout = "~/Pages/_Layout.cshtml";
    ViewData["Title"] = "SelectPdf Free Html To Pdf Converter for .NET Core - Getting Started with Html to Pdf Converter - C# / ASP.NET Core MVC6";
    ViewData["Description"] = "SelectPdf Getting Started 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"] = "getting started with html to pdf converter, 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 - Getting Started with Html to Pdf Converter - C# / ASP.NET Core MVC6 Sample</h1>
        </header>
        <!-- .entry-header -->

        <div class="entry-content">
            <p>
                This sample shows the simplest code that can be used to convert an url to pdf using SelectPdf Pdf Library for .NET.
            </p>
            <p>
                Starting with v19.1 SelectPdf Html To Pdf Converter offers 3 HTML rendering engines:<br />
                - Default rendering engine (based on WebKit) - this is the engine that was present in the previous versions also.<br />
                - Restricted rendering engine (also based on WebKit) - this has less features, but it can run on restricted environments, like Azure Web Apps.<br />
                - Blink rendering engine (the engine from Chrome browser) - this is only available for SelectPdf .NET Core version and also for the .NET Framework versions starting with 4.6.1.<br />
            </p>
            <p>
                Url:<br />
                <input type="text" style="width: 90%;" value="https://selectpdf.com" asp-for="TxtUrl" />
                <br /><br />
                Rendering Engine:<br />
                <select asp-for="DdlRenderingEngine" asp-items="Model.RenderingEngines"></select>
                <br />
                <br />
                <input type="submit" name="BtnConvert" value="Create PDF" class="mybutton" />
            </p>
        </div>
        <!-- .entry-content -->
    </article>
    <!-- #post -->
</form>